I am using dojo script to create custom dropdown list. when I create dropdown,
dojo.forEach(tags, function(tag) {
var option = dojo.create("option", {
innerHTML: tag.name
});
dojo.place(option, Select);
});
});
I create this drop-down to achieve the autocomplete.
Now the problem is I would like some of the opitions disabled, so user cannot select them.
how can I do this?
AFAIK and was trying there is not such a possibility. I think it makes very little sense to mix autocomplete with disabled values. Possible solutions:
dijit.form.Selector nativeSelect, both works fine with<option disabled="true"></option>.dijit.form.FilteringSelectand don’t add or dynamically remove options you want to disable.Please note that
dijit.form.FilteringSelectanddijit.form.ComboBoxare primarily designed to work with model based on API ofdojo.dataand from Dojo 1.7 alsodojo.store. You should update Model (dojo.data/dojo.store) because View (FilteringSelect/ComboBox) is observing the model and updates UI when needed. See my jsFiddle examples.N.B.: If you are not familiar with
dojo.dataAPI and you can use the latest version of Dojo don’t bother to dive into dojo.data API and start withdojo.store. It’s terribly wrong and complicated way to manage model via dojo.data.