DojoToolkit widget.placeAt()方法参考

Nel*_*ira 0 javascript dojo

In DojoToolkit documentation, the page "Creating a custom widget" (this one) it's said that in order to instantiate the new widget, you use the following code:

var widget = new AuthorWidget(author).placeAt(authorContainer);
Run Code Online (Sandbox Code Playgroud)

I spent quite some time trying to find the documentation for "placeAt" method, and can't find it. Now I know Dijit's widgets are derived from dijit/_WidgetBase and dijit/_TemplatedMixin classes, but this method isn't in any of these classes.

The nearest thing that searches find is domConstruct.place() method.

Anyone knows where the documentation for this method is ?

Gib*_*boK 5

placeAt(reference,position)可以在module中找到,dijit/_WidgetBase它提供了一种将现有(或新创建的)Widget放入dom的简便机制。

例子:

// create a Button with no srcNodeRef, and place it in the body:
var button = new Button({ label:"click" }).placeAt(win.body());
Run Code Online (Sandbox Code Playgroud)

链接到文档:http : //dojotoolkit.org/api/?qs=1.10/dijit/_WidgetBase