I use a very simple dijit/form/select on my webppage I add few options by code like this :
option1 = { value: "o1", label: "option 1", selected: false };
option2 = { value: "o2", label: "option 2", selected: true };
this.mySelect.addOption([option1, option2]);
It's working. However when I try to clear my dijit/form/select using this code :
this.mySelect.removeOption(this.mySelect.getOption());
All my options are gone except the selected one.
I try using a .reset or even a .value = '' but nothing worked.
So how to remove all options from a dijit/form/select ?
Actually the answer is pretty simple, but not well docummented
(it's pretty hard to find, like all dojo related stuff)Demo: JSFiddle demo