Reputation: 550
In Dojo I want to set the first/top option of may Store as the default/displaying option/text of the combo box. I went through the documentation to found no help. if anyone have done that before please share your opinion.
Ps - I can't use ID or name of the option to set it. I want to display what ever the data item somes first in the store to display.
Thanks in advance.
and this is how my combo-box looks like
var Selectbox = new dijit.form.ComboBox({
id: "box1",
disabled:true,
uppercase:true,
autoComplete:false,
trim:true,
value: "boxvalue",
store:detailDataStore,
style:"width:120px; color:black;"
}).placeAt(topContentPane10.containerNode);
Upvotes: 2
Views: 3747
Reputation: 813
There isn't a magic property to set the combobox default selection from a store, you'll have to set it manually.
Something like this:
box.set('value',store.data[0].value)
See this fiddle: http://jsfiddle.net/Gkbpb/1/
Upvotes: 3