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.MenuIte开发者_开发问答m({
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?
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.)
精彩评论