rdchappell

Query data won't populate datagrid

Discussion created by rdchappell on Jul 9, 2011
I'm trying to query point data using a buffer geometry, but I can't get the query data to populate my datagrid. I set up a console.log(data) line and it shows my data is there, so why isn't it populating?

Here is my relevant javascript code:

dojo.connect(queryTask, "onComplete", function(featureSet) {
            //create symbol for selected features
            var items = [];
            var symbol = new esri.symbol.SimpleMarkerSymbol();
            symbol.style = esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE;
            symbol.setSize(8);
            symbol.setColor(new dojo.Color([255, 255, 0, 0.5]));
            var resultFeatures = featureSet.features;
            for (var i = 0, il = resultFeatures.length; i < il; i++) {
                
                var graphic = resultFeatures[i]
                graphic.setSymbol(symbol);
                map.graphics.add(graphic);
            }
            var items = dojo.map(resultFeatures, function(feature) {
                return feature.attributes;
            });
            
            var data = { identifier: "FID", items: items };
            store = new dojo.data.ItemFileReadStore({ data: data });
            grid.setStore(store);
        });


The html grid setup:

<table dojotype="dojox.grid.DataGrid" 
           jsid="grid" id="grid" style="width:100%;height:100%;"                             
           selectionMode="none"> 
          <thead> 
            <tr> 
              <th field="fid">FID</th>
              <th field="type">Type</th>
              <th field="url" width="100%">URL</th>   
            </tr> 
          </thead> 
        </table>

Outcomes