Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

dojo

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

like image 644
screenm0nkey Avatar asked Nov 03 '11 14:11

screenm0nkey


1 Answers

dijit.byId("selectmenu").addOption({disabled:false,label:'label',selected:true,value:1});
like image 111
screenm0nkey Avatar answered Sep 20 '22 02:09

screenm0nkey