Select to view content in your preferred language

Combobox not populating... data object of ItemFileReadStore not recieving values.

910
1
Jump to solution
09-17-2013 11:12 PM
VishakhaDubey
Deactivated User
Hi all

I am having trouble in populating combobox while using ArcGIS API for Javascript v3.6.

The data object in ItemFileReadStore is not recieving the array of objects passed. My code is below.

dojo.require("dojo.data.ItemFileReadStore"); dojo.require("dijit.form.ComboBox"); dojo.require("esri.tasks.query"); function selectData() {  alert("in selectData");     queryTask1 = new esri.tasks.QueryTask             (mapURL);     query1 = new esri.tasks.Query();    query1.returnGeometry = true;    query1.outFields = ["AC_Name"];    query1.where = "District= 'Nagpur' ";    queryTask1.execute(query1,populateList); }  //to fill AC_Name combobox function populateList(results) {   alert("in populateList");     //Populate the ComboBox with unique values     var values = [];     var testVals={};     //Add option to display all zoning types to the ComboBox     values.push({name:"ALL"})      //Loop through the QueryTask results and populate an array     //with the unique values      var features = results.features;     dojo.forEach (features, function(feature1) {         acName = feature1.attributes.AC_Name;       if (!testVals[acName]) {         testVals[acName] = true;         values.push({name:acName});       }     });     //Create a ItemFileReadStore and use it for the     //ComboBox's data source     var dataItems = {            identifier: 'name',            label: 'name',            items: values     };     var store = new dojo.data.ItemFileReadStore({data:dataItems.items});     dijit.byId("mySelect").store = store;      }


I have used this same code in my other application built using ArcGIS API v2.6 and its working fine. But {data:dataItems.items} does not get any values in v3.6.
Any help is appreciated.
0 Kudos
1 Solution

Accepted Solutions
VishakhaDubey
Deactivated User
I got the answer. Problem is solved by using "dojo.store.Memory" instead of "dojo.data.ItemFileReadStore".

View solution in original post

0 Kudos
1 Reply
VishakhaDubey
Deactivated User
I got the answer. Problem is solved by using "dojo.store.Memory" instead of "dojo.data.ItemFileReadStore".
0 Kudos