开发者

How to render Dijit widgets?

开发者 https://www.devze.com 2023-02-04 19:16 出处:网络
I am trying to render Dijit widgets without success. For example, I would like to create a toolbar: var tb = new dijit.Toolbar({

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

精彩评论

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