Dojotoolkit Widget. placeAt() Method Reference

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);

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 ?

1

1 Answer

placeAt(reference,position) can be found in moduledijit/_WidgetBase and it provides a shorthand mechanism to put an existing (or newly created) Widget in the dom.

Examples:

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

Link to documentation:

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article
Twitter Facebook Pinterest