I was using dijit.form.ComboBox
, but the requirement has changed, and now dijit.form.Select
is more appropriate.
However, after changing the widget type I get an error:
TypeError: _b6d.getLabel is not a function
From the documentation http://dojotoolkit.org/reference-guide/1.10/dijit/form/Select.html I see that dijit.form.Select
expect fields id
and label
in the Store, while my Store has id
and name
.
The documentation gives no example how to override that defaults. So, how can I specify the id
and label
attributes for dijit.form.Select
?
My data looks like that:
[{"id":1,"name":"Item 1"},{"id":2,"name":"Item 2"},{"id":3,"name":"Item 3"}]
In case it's not possible, what dijit widget can I use for selection restricted only to items from Store?