Because you're using setData()
incorrect. The setData()
expects an array of objects to be inserted. However, you're using it to insert d
, which is a store by itself. So, the correct way of setting the data would by by using:
dijit.byId('stateSelect').get('store').setData(d.query());
Because if you use the query()
function without parameters, it will return all objects inside the store (as an array).
However, you could also directly change the store of the combobox by using:
dijit.byId('stateSelect').set('store', d);
Here's a simple example using the store setter.