开发者

How to dynamically create a drop down entry using dojo

var DD =dojo.byId("xyz");
var optn = document.createElement("OPTION");
optn.text="text"
optn.value="val"
DD.options.add(optn);

What will be the dojo equivalend开发者_StackOverflow中文版 of above js code?


use fallowing code to create a drop down entry dynamically:

dojo.addOnLoad(function () {
    var select = dijit.byId("selBox");
    select.addOption([{ label: 'newValue1', value: 'nv1' }, { label: 'newValue2', value: 'nv2'}]);
    });

Full working example you can find here

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜