I am using Dojo 1.5 to create dijit.form.Select with some data from the data warehouse. The problem I find is that I want the selection to display items sorted by identifier, but select ginving them sorted by label. How can I avoid this behavior? Another problem that I discovered is that when I install the repository, I initialized the repository to select one of the items, but it selects the first. The code is as follows:
dojo.require("dijit.form.Select"); dojo.require('dojo.data.ItemFileReadStore'); dojo.addOnLoad(function(){ var boxContent = {"identifier":"idBox","items":[{"accessLevel":"FULL_ACCESS", "boxName":"My Documents","boxType":"PERSONAL","idBox":1512,"numberFiles":9, "userDisplayName":"Jose Luis Martinez Avial","userName":"MIAMARA"}, {"accessLevel":"FULL_ACCESS","boxName":"12312312","boxType":"PERSONAL", "idBox":17100,"numberFiles":0,"userDisplayName":"Jose Luis MartinezAvial", "userName":"MIAMARA"}],"label":"boxName"}; var myStore = new dojo.data.ItemFileReadStore({data: boxContent }); var boxCombo= new dijit.form.Select({ name: 'select2' }).placeAt(dojo.body()); boxCombo.setStore(myStore,1512); })
It is available at http://jsfiddle.net/m9ucX/1/
Thank you for your help.
Jose L Martinez-Avial
source share