<?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 Add more selection parcels to current datagrid in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-more-selection-parcels-to-current-datagrid/m-p/501223#M46530</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I try to select some parcels and shows the results on the same previous search results datagrid table.&amp;nbsp; I only able to see additional graphics being add on the map but no additional parcels being added to the current table. Besides that, how do you shows the total results after you added the selection parcels?&lt;/P&gt;&lt;P&gt;Here is my jsfiddle:&lt;/P&gt;&lt;P&gt;&lt;A href="http://jsfiddle.net/MayJeff00/m6gw4yj5/" title="http://jsfiddle.net/MayJeff00/m6gw4yj5/"&gt;Edit fiddle - JSFiddle&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me to take a looks.&amp;nbsp; Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Apr 2015 17:23:14 GMT</pubDate>
    <dc:creator>MayJeff</dc:creator>
    <dc:date>2015-04-22T17:23:14Z</dc:date>
    <item>
      <title>Add more selection parcels to current datagrid</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-more-selection-parcels-to-current-datagrid/m-p/501223#M46530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I try to select some parcels and shows the results on the same previous search results datagrid table.&amp;nbsp; I only able to see additional graphics being add on the map but no additional parcels being added to the current table. Besides that, how do you shows the total results after you added the selection parcels?&lt;/P&gt;&lt;P&gt;Here is my jsfiddle:&lt;/P&gt;&lt;P&gt;&lt;A href="http://jsfiddle.net/MayJeff00/m6gw4yj5/" title="http://jsfiddle.net/MayJeff00/m6gw4yj5/"&gt;Edit fiddle - JSFiddle&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me to take a looks.&amp;nbsp; Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2015 17:23:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-more-selection-parcels-to-current-datagrid/m-p/501223#M46530</guid>
      <dc:creator>MayJeff</dc:creator>
      <dc:date>2015-04-22T17:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: Add more selection parcels to current datagrid</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-more-selection-parcels-to-current-datagrid/m-p/501224#M46531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I made a couple of changes to it &lt;A href="http://jsfiddle.net/kenbuja/m6gw4yj5/1/" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;​ to make it work correctly. Your issue was that you were populating the array "parcelItems" with only the new features selected. You want to add these features to that array instead. This is the new version of the function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; function onDrawEnd2(extent) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //clearParcelGrid();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; toolBar2.deactivate();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var query2 = new esri.tasks.Query();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query2.geometry = extent;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureLayerParcel.selectFeatures(query2, esri.layers.FeatureLayer.SELECTION_ADD, function (features, selectionMethod) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var newparcelItems = dojo.map(features, function (feature) {
&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 feature.attributes;
&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; arrayUtils.forEach(newparcelItems, function (item) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parcelItems.push(item);
&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; parcelData = {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; identifier: "PARCELID",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; items: parcelItems
&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; parcelStore = new dojo.data.ItemFileWriteStore({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data: parcelData
&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; parcelGrid = registry.byId("gridP");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parcelGrid.setStore(parcelStore);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById("totalresults").innerHTML = parcelItems.length + " result(s).";

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arrayUtils.forEach(features, function (feature) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graphic = new Graphic(feature.geometry, symbol);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.graphics.add(graphic);
&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;P&gt;&lt;/P&gt;&lt;P&gt;I initialized this variable as an array at the beginning of the script and also emptied the array in the clearParcelGrid function to prepare it for searches.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:00:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-more-selection-parcels-to-current-datagrid/m-p/501224#M46531</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-12-11T22:00:04Z</dc:date>
    </item>
  </channel>
</rss>

