I have a DropDownSelect element set up with the following HTML tags:
<select id="someId" dojoType="dojox.form.DropDownSelect" >
<option>Loading...</option>
</select>
Now, when the xhr load function is triggered, I want to replace the initial "Loading..." option with a new option like "Choose Option". Here's my current approach:
load: function(response) {
// Removing the existing option while keeping it displayed
dojo.byId("someId").removeChild(dojo.byId("someId").lastChild);
// Adding the new desired option below
dijit.byId("someId").addOption({label: "Choose Option", value:"Select"});
// Attempt to set the displayedValue (not working)
//dijit.byId("someId").setAttribute('displayedValue','Select');
// Adding additional options fetched through ajax
dijit.byId("someId").addOption(response);
return response;
},
Can anyone suggest how to display a different option in a DropDownSelect using Dojo version 1.3?