citizens

Object has no method 'query'

Discussion created by citizens on Jul 9, 2012
Latest reply on Jul 9, 2012 by citizens
I'm extending the "Add Shapefile" example to allow the user to select a column from the shapefile by which to set the symbology of the layer added...

Taking a featureCollection, extracting field names to populate a dijit.form.ComboBox:

This part works:
function populateColumnDropDown(featureCollection){
 names = featureCollection.layers[0].layerDefinition.fields;
 var fieldNames = [];
 for(i = 0; i < names.length; i++){
  if(names[i].name != "FID"){
   fieldNames.push({name:names[i].name});
  }
 }
 var dataItems = {
         identifier: 'name',
         label: 'name',
         items: fieldNames
 };
 var store = new dojo.data.ItemFileReadStore({data:dataItems});
 dijit.byId("columnInput").store = store;
}

<select id="columnInput" dojotype="dijit.form.ComboBox" style="width:150px;" value="Select Column" title="Select Column To Symbolize" fetchProperties="{sort:[{attribute:'name', descending:false}]}" onChange="setSymbology();" disabled></select>


No errors are thrown until I click the comboBox to see the values. Then it throws a: Object has no method 'query' error.

Any thoughts?

Outcomes