开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜