AnsweredAssumed Answered

Query works but populate data grid doesn't

Question asked by dashton on May 15, 2012
Latest reply on May 16, 2012 by dashton
I have a query that works.  It creates a graphic, zooms to the graphics, and creates the info window for the graphics but I can't seem to populate my store and fill my grid...can someone take a look at my items array and tell me what's off.

Thanks -D

 var txtSing = "SIGNTYPE = ";   var grid;          function doQuery() {           query.where = (txtSing + "\'" + dojo.byId("SignQuery").value + "\'").toString();         //execute query         queryTask.execute(query,showFResults);       }         function showFResults(results) {                    //remove all graphics on the maps graphics layer     map.graphics.clear();         esri.show(dojo.byId("grid"));               var polygonSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([98,194,204]), 2), new dojo.Color([98,194,204,0.5]));         var markerSymbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 20, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0, 0, 255]), 1), new dojo.Color([0, 255, 0, 0.25]));         var lineSymbol = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASH, new dojo.Color([255, 0, 0]), 1);             var items = [];                 dojo.forEach(results.features, function (feature) {                     var graphic = feature;                     switch (graphic.geometry.type) {                case "point":                  graphic.setSymbol(markerSymbol);                  break;                case "polyline":                  graphic.setSymbol(lineSymbol);                  break;                case "polygon":                  graphic.setSymbol(polygonSymbol);                  break;                }                                // //Set the infoTemplate.               graphic.setInfoTemplate(SignInfoTemplate);                                //Add graphic to map                     map.graphics.add(graphic);                   //  return feature.feature.attributes;                     items.push(feature.attributes);                 });                                       //Create data object to be used in store         var data = {           identifier: "OBJECTID",  //This field needs to have unique values           label: "OBJECTID", //Name field for display. Not pertinent to a grid but may be used elsewhere.           items: items         };           //Create data store and bind to grid.         store = new dojo.data.ItemFileReadStore({ data:data });         grid = dijit.byId('grid');         grid.setStore(store);       // Show Grid     // esri.show(dojo.byId("grid"));                   //Zoom back to extent of graphics selected                   var graphicExtent = esri.graphicsExtent(map.graphics.graphics);        map.setExtent(graphicExtent);       }

Outcomes