Tower
Tower

Reputation: 102795

How to render Dijit widgets?

I am trying to render Dijit widgets without success. For example, I would like to create a toolbar:

var tb = new dijit.Toolbar({
});

tb.addChild(new dijit.MenuItem({
label: 'test'
}));

tb.placeAt(document.getElementById('menu'));

tb.startup();

Based on the documentation, there are no render, etc methods available. How am I supposed to render it or any other widgets?

Upvotes: 1

Views: 513

Answers (1)

kprevas
kprevas

Reputation: 2442

placeAt() "renders" the widget by placing its DOM node somewhere on the page. I think you're supposed to call startup() before you do that, though.

(Incidentally, you can just pass the ID to placeAt(); the call to getElementById() is unnecessary.)

Upvotes: 1

Related Questions