开发者

Add options to Dojo Dropdown list box

开发者 https://www.devze.com 2023-01-26 18:44 出处:网络
How to programmatically add an option to a dijit.form.Select . I\'ve lo开发者_运维技巧oked all over the place and I\'m not able to find it. I think looking at the documentation you would see addOption

How to programmatically add an option to a dijit.form.Select . I've lo开发者_运维技巧oked all over the place and I'm not able to find it.


I think looking at the documentation you would see addOption

mySelect.addOption( { label: "new option", value: 1 } );


this question is old but I want to add some helpful information: you can use not only plain text for label. Additionally enhanced markup can be used

mySelect.addOption( { label: "<div><img src="images/girl.png"> Label </div>", value: 1 } );
0

精彩评论

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