I'm using dojo version 1.14.2 with dstore version 1.1.2. I'm trying to populate the select with the memory store and the select just remains empty.
the classes I'm using are: "dstore/Memory", "dstore/legacy/DstoreAdapter", "dijit/form/Select"
I'm attempting to populate the select using this code:
GetJobCategoriesConfirm: function (data, msg) {
if (msg === "ok") {
JobCategoryStore = new Memory({ data: data.JobCategoriesGetResult, idProperty: "Category" });
this.selectJobCategory.set("labelAttr", "Category");
this.selectJobCategory.setStore(JobCategoryStore);
//this.selectJobCategory.set("store", JobCategoryStore); //doesnt work either
}
else {
alert(msg);
}
}
I've confirmed that I'm getting the data from the function in a json format (there are 14 records), the store object looks ok, the select is named correctly, the columns in the datastore are named correctly and the CategoryID is a string. No error is being thrown, its just that the select doesn't get populated with the data. Any ideas as to what might be going on?
Thanks
Pete
Site Penn had an answer here: https://github.com/SitePen/dstore/blob/master/docs/Adapters.md
I needed to implement the DstoreAdaptor so that the dstore could be used as a legacy dojo/store. The new code is: