Add options to Dojo Dropdown list box
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 } );
精彩评论