<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: populate a dgrid with results of a querytask in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/populate-a-dgrid-with-results-of-a-querytask/m-p/222093#M20608</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Results is an object, not the array itself.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Change:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data = arrayUtil.map(results, function(schoolFeatures){
&amp;nbsp;&amp;nbsp;&amp;nbsp; return {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'facility': schoolFeatures.attributes[Facility],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'address': schoolFeatures.attributes[Address],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'city': schoolFeatures.attributes[City],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; };
&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data = arrayUtil.map(results.featureSet.features, function(schoolFeature){
&amp;nbsp;&amp;nbsp;&amp;nbsp; return {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'facility': schoolFeature.attributes[Facility],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'address': schoolFeature.attributes[Address],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'city': schoolFeature.attributes[City],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; };
&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 10:49:18 GMT</pubDate>
    <dc:creator>JasonZou</dc:creator>
    <dc:date>2021-12-11T10:49:18Z</dc:date>
    <item>
      <title>populate a dgrid with results of a querytask</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/populate-a-dgrid-with-results-of-a-querytask/m-p/222090#M20605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am running a querytask against a school layer and I need to be able to present the data in a dgrid with a rowrenderer.&amp;nbsp; I'm getting stuck formatting the data to populate the dgrid.&amp;nbsp; I'm new to the AMD format, I might not be using arrayUtil.map properly.&amp;nbsp;&amp;nbsp; I commented out most of this, just to verify that my queryTask is executing. It is, but restoring the entire function, it fails, just firing my errorHandler instead.&amp;nbsp; The error comes back 'undefined', which is no help at all!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm pretty sure the problem is in the lines that define the variable 'data'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;function createSchoolList (results) { &amp;nbsp;&amp;nbsp;&amp;nbsp; var resultsLength = results.featureSet.features.length; &amp;nbsp;&amp;nbsp;&amp;nbsp; var data = []; &amp;nbsp;&amp;nbsp;&amp;nbsp; var schoolFeatures = results.featureSet.features;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if (dGridStacked) { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dGridStacked.refresh(); &amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if (dGridTable) { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dGridTable.refresh(); &amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; data = arrayUtil.map(results, function(schoolFeatures){ &amp;nbsp;&amp;nbsp;&amp;nbsp; return { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'facility': schoolFeatures.attributes[Facility], &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'address': schoolFeatures.attributes[Address], &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'city': schoolFeatures.attributes[City], &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }; &amp;nbsp;&amp;nbsp; });&amp;nbsp; &amp;nbsp;&amp;nbsp; dGridStacked = new dgrid.Grid({ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; renderRow: renderRowFunction, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; showHeader: true &amp;nbsp;&amp;nbsp; }, "searchResultsGrid"); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; dGridStacked.startup(); &amp;nbsp;&amp;nbsp;&amp;nbsp; dGridStacked.renderArray(data); &amp;nbsp;&amp;nbsp;&amp;nbsp; dGridStacked.sort('facility'); &amp;nbsp;&amp;nbsp; &amp;nbsp; dGridStacked.on('.dgrid-row:click', function(event){ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; highlightGridSelection(event, dGridStacked);&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; });&amp;nbsp;&amp;nbsp; console.log(data);&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } function renderRowFunction (obj,options) { &amp;nbsp;&amp;nbsp; var template = '&amp;lt;div class="title"&amp;gt;${0}&amp;lt;/div&amp;gt;&amp;lt;div class="details"&amp;gt;Address: ${1}&amp;lt;/div&amp;gt; &amp;lt;div class="details"&amp;gt;City: ${2}&amp;lt;/div&amp;gt;'; &amp;nbsp;&amp;nbsp;&amp;nbsp; return dojo.create("div",{ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; innerHTML : dojo.string.substitute(template,[obj.facility,obj.address,obj.city]) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }); }&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2013 14:53:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/populate-a-dgrid-with-results-of-a-querytask/m-p/222090#M20605</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2013-09-26T14:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: populate a dgrid with results of a querytask</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/populate-a-dgrid-with-results-of-a-querytask/m-p/222091#M20606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Do you also need to set the columns property of the dgrid? I'm using the dgrid to hold the contents of an IdentifyTask. This will be for a variety of layers, so I'm not hard coding the column list, which will show all the fields except the Shape field. This also adds the dgrid to a ContentPane and sets up some events.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var columns = buildColumns(results[0].feature);&amp;nbsp; //builds the column list from the first feature
var features = [];

for (i = 0, len = results.length; i &amp;lt; len; i++) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; features.push(results&lt;I&gt;.feature);
}

var data = array.map(features, function (feature) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; return lang.clone(feature.attributes);
});

var dataGrid = new (declare([Grid, Selection, DijitRegistry, ColumnHider]))({
&amp;nbsp;&amp;nbsp;&amp;nbsp; id: "dgrid_0",
&amp;nbsp;&amp;nbsp;&amp;nbsp; bufferRows: Infinity,
&amp;nbsp;&amp;nbsp;&amp;nbsp; columns: columns,
&amp;nbsp;&amp;nbsp;&amp;nbsp; selectionMode: "single",
&amp;nbsp;&amp;nbsp;&amp;nbsp; "class": "resultsGrid"
});


var gridWidth = "width: " + String(columns.length * 100) + "px";
dataGrid.addCssRule("#" + dataGrid.id, gridWidth); //this makes the dgrid large enough to show all the columns

dataGrid.on(".dgrid-row:click", gridSelect);&amp;nbsp; //this flashes the feature
dataGrid.on("show", function () {
&amp;nbsp;&amp;nbsp;&amp;nbsp; dataGrid.resize();
});
dataGrid.on(mouseUtil.enterRow, gridEnter); //this highlights the feature
dataGrid.on(mouseUtil.leaveRow, function () {
&amp;nbsp;&amp;nbsp;&amp;nbsp; map.graphics.clear();
});
var plural = "";
if (combineResults[result].length !== 1) { plural = "s"; }
var cp = new dijit.layout.ContentPane({
&amp;nbsp;&amp;nbsp;&amp;nbsp; id: result,
&amp;nbsp;&amp;nbsp;&amp;nbsp; content: "&amp;lt;strong&amp;gt;" + combineResults[result][0].layerName + "&amp;lt;/strong&amp;gt; (" + combineResults[result].length + " feature" + plural + ")",
&amp;nbsp;&amp;nbsp;&amp;nbsp; title: combineResults[result][0].layerId,
&amp;nbsp;&amp;nbsp;&amp;nbsp; style: "overflow: auto"
}).placeAt(dijit.byId('tabs'));

cp.addChild(dataGrid);
cp.startup();

dataGrid.renderArray(data);



&amp;nbsp;&amp;nbsp;&amp;nbsp; function buildColumns(feature) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var attributes = feature.attributes;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var columns = [];

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (var attribute in attributes) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (attributes.hasOwnProperty(attribute)) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var objects = {};
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objects.label = attribute;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objects.field = attribute;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (attribute === "Shape") {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objects.hidden = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; columns.push(objects);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return columns;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/I&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is part of an application to show the results from different layers in a service in one Tab Container contain a dgrid for each layer. Here's a &lt;/SPAN&gt;&lt;A href="http://jsfiddle.net/GW7XK/6/" rel="nofollow noopener noreferrer" target="_blank"&gt;Fiddle &lt;/A&gt;&lt;SPAN&gt;that shows it in action.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:49:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/populate-a-dgrid-with-results-of-a-querytask/m-p/222091#M20606</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-12-11T10:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: populate a dgrid with results of a querytask</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/populate-a-dgrid-with-results-of-a-querytask/m-p/222092#M20607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I copied this from an existing project which processes results from a selectFeatures request on a featureLayer instead of from a queryTask.&amp;nbsp; There it works properly without the column definitions you're suggesting.&amp;nbsp; I really don't think that's the problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2013 15:51:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/populate-a-dgrid-with-results-of-a-querytask/m-p/222092#M20607</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2013-09-26T15:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: populate a dgrid with results of a querytask</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/populate-a-dgrid-with-results-of-a-querytask/m-p/222093#M20608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Results is an object, not the array itself.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Change:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data = arrayUtil.map(results, function(schoolFeatures){
&amp;nbsp;&amp;nbsp;&amp;nbsp; return {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'facility': schoolFeatures.attributes[Facility],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'address': schoolFeatures.attributes[Address],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'city': schoolFeatures.attributes[City],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; };
&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data = arrayUtil.map(results.featureSet.features, function(schoolFeature){
&amp;nbsp;&amp;nbsp;&amp;nbsp; return {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'facility': schoolFeature.attributes[Facility],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'address': schoolFeature.attributes[Address],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'city': schoolFeature.attributes[City],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; };
&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:49:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/populate-a-dgrid-with-results-of-a-querytask/m-p/222093#M20608</guid>
      <dc:creator>JasonZou</dc:creator>
      <dc:date>2021-12-11T10:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: populate a dgrid with results of a querytask</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/populate-a-dgrid-with-results-of-a-querytask/m-p/222094#M20609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That was part of it.&amp;nbsp; The other part was invalid syntax getting each value on the attributes.&amp;nbsp; I'm not sure where I got the idea I needed square brackets.&amp;nbsp; Maybe in another scenario that's appropriate.&amp;nbsp; It should be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data = arrayUtil.map(results.featureSet.features, function(feature){ &amp;nbsp;&amp;nbsp;&amp;nbsp; return { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'facility': feature.attributes.Facility, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'address': feature.attributes.Address, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'city': feature.attributes.City, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2013 17:20:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/populate-a-dgrid-with-results-of-a-querytask/m-p/222094#M20609</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2013-09-26T17:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: populate a dgrid with results of a querytask</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/populate-a-dgrid-with-results-of-a-querytask/m-p/222095#M20610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It's ok to use square brackets, but need to quote the attribute name, like schoolFeatures.attributes["Facility"]. If using schoolFeatures.attributes[Facility], then Facility should be a string variable holding the field name. I did miss that part in my previous post.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2013 18:27:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/populate-a-dgrid-with-results-of-a-querytask/m-p/222095#M20610</guid>
      <dc:creator>JasonZou</dc:creator>
      <dc:date>2013-09-26T18:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: populate a dgrid with results of a querytask</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/populate-a-dgrid-with-results-of-a-querytask/m-p/222096#M20611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This works fine in Firefox, but testing it in IE, which is still the state's standard browser gives an error on the line that is defining the data variable:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Expected identifier, string or Number.&amp;nbsp; I assume that data is an object and IE doesn't like it?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Sep 2013 12:55:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/populate-a-dgrid-with-results-of-a-querytask/m-p/222096#M20611</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2013-09-27T12:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: populate a dgrid with results of a querytask</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/populate-a-dgrid-with-results-of-a-querytask/m-p/222097#M20612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The problem looks to be with the difference between an array and an object.&amp;nbsp; I had data defined as an array and IE didn't like that.&amp;nbsp; I changed this to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function createSchoolList (results) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; var resultsLength = results.featureSet.features.length;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var schoolList = {};

&amp;nbsp;&amp;nbsp;&amp;nbsp; if (dGridStacked) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dGridStacked.refresh();
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (dGridTable) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dGridTable.refresh();
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; schoolList.data = arrayUtils.map(results.featureSet.features, function(feature){

&amp;nbsp;&amp;nbsp;&amp;nbsp; return {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "facility": feature.attributes["Facility"],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "address": feature.attributes["Address"],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "city": feature.attributes["City"]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; };
&amp;nbsp;&amp;nbsp; });

&amp;nbsp;&amp;nbsp; dGridStacked = new dgrid.Grid({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; renderRow: renderRowFunction,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; showHeader: true
&amp;nbsp;&amp;nbsp; }, "searchResultsGrid");
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; dGridStacked.startup();
&amp;nbsp;&amp;nbsp;&amp;nbsp; dGridStacked.renderArray(schoolList.data);
&amp;nbsp;&amp;nbsp;&amp;nbsp; dGridStacked.sort('facility');
&amp;nbsp; 

&amp;nbsp; dGridStacked.on('.dgrid-row:click', function(event){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; highlightGridSelection(event, dGridStacked);

&amp;nbsp;&amp;nbsp;&amp;nbsp; });
queryDistrict();
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This works OK in IE.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:49:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/populate-a-dgrid-with-results-of-a-querytask/m-p/222097#M20612</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2021-12-11T10:49:21Z</dc:date>
    </item>
  </channel>
</rss>

