screenm0nkey
screenm0nkey

Reputation: 18805

How do I dynamically insert new options into dijit.form.Select

I've got a dijit select menu and I'm trying to insert new options dynamically. From inside the widget which generates the select menu I tried the following but it didn't work;

this.selectMenu.domNode.innerHTML = options 

this.selectMenu is the attach-point and options is the html for the options I'd like to insert

The code above replaces the entire select menu, rather than insert the options

Many thanks in advance

Upvotes: 5

Views: 7159

Answers (1)

screenm0nkey
screenm0nkey

Reputation: 18805

dijit.byId("selectmenu").addOption({disabled:false,label:'label',selected:true,value:1});

Upvotes: 8

Related Questions