ho0mwp

Datagrid Object Error on var Data

Discussion created by ho0mwp on May 1, 2014
Currently I am getting a bunch of blank values in my datagrid.  It was stopping at the var Data but now seems to be okay with that for some strange reason.

When I walk through everything it looks like all of the valuse are going into the data but they are not going into my grid. 
  function showResults(featureSet) {    
//  Clear Datagrid     
    //create an empty store and then bind to grid
    //var emptyCells = { items: "" };
 // var emptyStore = new dojo.data.ItemFileWriteStore({data: emptyCells});
  // grid = dijit.byId('grid');
     // grid.setStore(emptyStore);
//Create symbols for graphics
    var symbol = new  esri.symbols.SimpleMarkerSymbol(
       esri.symbols.SimpleMarkerSymbol.STYLE_CIRCLE, 
      12, 
      new esri.symbols.SimpleLineSymbol(
     esri.symbols.SimpleLineSymbol.STYLE_NULL, 
     new dojo._base.Color([0, 0, 0, 0.9]), 
     1
      ),
      new dojo._base.Color([0, 0, 0, 0.5]))

   var dataForGrid = [];
 var temp = "";
    //remove all graphics on the maps graphics layer    
    map.graphics.clear();   
     //Performance enhancer - assign featureSet array to a single variable.    
     var resultFeatures = featureSet.features;    
     //Loop through each feature returned    

     for (var i=0, il=resultFeatures.length; i<il; i++) {      
     //Get the current feature from the featureSet.      
     //Feature is a graphic      
     var graphic = resultFeatures[i];      
     // orig graphic.setSymbol(symbol);
     resultFeatures[i].setSymbol(symbol);  
     map.graphics.add(resultFeatures[i]); 
     
     
                    //Add result feature to table
              var varFID = graphic.attributes.FID;
              var varDISTRICT = graphic.attributes.DISTRICT;
              var varSTORENAME = graphic.attributes.STORENAME;
               var attValues = [varFID, varDISTRICT, varSTORENAME];
               //temp += objectid + ",";
               dataForGrid.push(attValues);

     };

  
  //  dojo.forEach(resultFeatures, function (feature) {
  //      dataForGrid.push([feature.FID,feature.DISTICT,feature.STORENAME])
  //      });
    var data = {
        items: dataForGrid
        };
    var store = new dojo.data.ItemFileReadStore({data:data});
    grid.setStore(store);


Outcomes