AnsweredAssumed Answered

dgrid/Grid not displaying values

Question asked by sibghatullah86 on Apr 10, 2017
Latest reply on Apr 10, 2017 by thejus.kambi

I am running a query to get count of features on two layers and show it in a dgrid . Dgrid is  only hsowing the headings and nothing else .I have run the code using alert() and get the counts of both layers. I think the problem is in array.Please guide.

 

 

on(dom.byId("search1"), "click", function () {

var typesData = [];

for(var j=15;j<17;j++){

var queryTask3 = new esri.tasks.QueryTask("http://localhost:6080/arcgis/rest/services/RAEC/MapServer/"+j);

var query3 = new esri.tasks.Query();

query.outFields = ["OBJECTID"];

query3.returnGeometry = false;

query3.where = "FeederID='HITAM POW F2'";

queryTask3.executeForCount(query3,function (count) {

//alert(count);

var b={ field: j, field1: count };

typesData.push(b);

});

}

var grid= new Grid({   

     columns: {

field: 'Layers', field1: 'Count' }

}, 'grid');

grid.renderArray(typesData); });

Outcomes