<?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: cannot select dgrid row when feature on map is selected in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-select-dgrid-row-when-feature-on-map-is/m-p/41300#M3535</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello again everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I'm truly confused. I've boiled down the code above in an attempt to select the relevant row and scroll the selected row into view when a feature on the map is clicked (I'll worry about styling the selected row once I can get this to work). The function is selecting the relevant row (using the .isSelected() method to write to the console for verification), but not scrolling. I'm now receiving an 'undefined method' error on scrollIntoView();. This is interesting, since the sample &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;&lt;SPAN&gt; uses this method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my code, the featureName variable is described in the previous post: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function selectGrid(e) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; var row = window.grid.row(featureName);
&amp;nbsp;&amp;nbsp;&amp;nbsp; rowID = row.id;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (rowID === featureName) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.grid.select(row);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(grid.isSelected(row));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.grid.scrollIntoView(row);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I really appreciate any input into this matter.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- d&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 21:36:06 GMT</pubDate>
    <dc:creator>DerekMiller</dc:creator>
    <dc:date>2021-12-10T21:36:06Z</dc:date>
    <item>
      <title>cannot select dgrid row when feature on map is selected</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-select-dgrid-row-when-feature-on-map-is/m-p/41299#M3534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm currently working on an application that contains a feature layer (points) linked to a dgrid. I'm running into problems selecting the appropriate row in the dgrid when a feature on the map is selected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've defined a global variable that contains the unique feature name as a proxy for an id. This variable is overwritten each time the feature layer selection changes, by either clicking on a new feature or by scrolling through records in the popup. This much is functioning properly (writing the feature name to the console to verify). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am hoping that I can select the appropriate row in the grid based on this variable as opposed to re-querying the feature layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm currently receiving a 'non_object_property_call' to the error console as a result of the _Row element being null, even though I am able to write the _Row object to the console and determine that the _Row id matches the feature name variable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Code for my select grid function is this: &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;function selectGrid() { &amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("selecting grid"); &amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(featureName); &amp;nbsp;&amp;nbsp;&amp;nbsp; var row = grid.row(featureName); &amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(row); &amp;nbsp;&amp;nbsp;&amp;nbsp; rowID = row.id; &amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(rowID); &amp;nbsp;&amp;nbsp;&amp;nbsp; if (row.id === featureName) { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("derek sucks"); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //selectRow(row); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; grid.row(featureName).element.scrollIntoView(); &amp;nbsp;&amp;nbsp;&amp;nbsp; } }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also note that I'm using a dgrid/Grid as opposed to dgrid/onDemandGrid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any thoughts?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- d&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2012 17:53:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-select-dgrid-row-when-feature-on-map-is/m-p/41299#M3534</guid>
      <dc:creator>DerekMiller</dc:creator>
      <dc:date>2012-11-08T17:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: cannot select dgrid row when feature on map is selected</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-select-dgrid-row-when-feature-on-map-is/m-p/41300#M3535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello again everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I'm truly confused. I've boiled down the code above in an attempt to select the relevant row and scroll the selected row into view when a feature on the map is clicked (I'll worry about styling the selected row once I can get this to work). The function is selecting the relevant row (using the .isSelected() method to write to the console for verification), but not scrolling. I'm now receiving an 'undefined method' error on scrollIntoView();. This is interesting, since the sample &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;&lt;SPAN&gt; uses this method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my code, the featureName variable is described in the previous post: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function selectGrid(e) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; var row = window.grid.row(featureName);
&amp;nbsp;&amp;nbsp;&amp;nbsp; rowID = row.id;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (rowID === featureName) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.grid.select(row);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(grid.isSelected(row));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.grid.scrollIntoView(row);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I really appreciate any input into this matter.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- d&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:36:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-select-dgrid-row-when-feature-on-map-is/m-p/41300#M3535</guid>
      <dc:creator>DerekMiller</dc:creator>
      <dc:date>2021-12-10T21:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: cannot select dgrid row when feature on map is selected</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-select-dgrid-row-when-feature-on-map-is/m-p/41301#M3536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;can you explain the reason for your hesitance to avoid querying the client side features?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Nov 2012 17:40:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-select-dgrid-row-when-feature-on-map-is/m-p/41301#M3536</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2012-11-16T17:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: cannot select dgrid row when feature on map is selected</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-select-dgrid-row-when-feature-on-map-is/m-p/41302#M3537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Simply because it seems duplicative. I don't see the need to re-query the client-side features. They are already being queried on a map click, and the ID from the selected feature is being assigned to a global var being passed to the select grid function. It's probably not the best way to do it (and I would being interested in improving my code if you have any suggestions), but I was able to come up with a work-around:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function selectGrid(e) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; for (var i = 0; i &amp;lt; 250; i++) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; grid.clearSelection();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row = grid.row(i);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(row.data);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (row.data.id === featureID) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; grid.select(i);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.element.scrollIntoView();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;
&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;Application currently sits here: &lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.esri.com/www.portlandbps.com/gis/gda/index.html" target="_blank"&gt;www.portlandbps.com/gis/gda/index.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's buggy, particularly the 'zoom to feature and open popup when row in the grid is selected' feature I'm attempting to implement, but it's early.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- d&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:36:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-select-dgrid-row-when-feature-on-map-is/m-p/41302#M3537</guid>
      <dc:creator>DerekMiller</dc:creator>
      <dc:date>2021-12-10T21:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: cannot select dgrid row when feature on map is selected</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-select-dgrid-row-when-feature-on-map-is/m-p/41303#M3538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;&lt;BR /&gt;Application currently sits here: &lt;A _jive_internal="true" class="" href="https://community.esri.com/www.portlandbps.com/gis/gda/index.html"&gt;www.portlandbps.com/gis/gda/index.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;It's buggy, particularly the 'zoom to feature and open popup when row in the grid is selected' feature I'm attempting to implement, but it's early.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;- d&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This has been resolved as well. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- d&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2012 20:42:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-select-dgrid-row-when-feature-on-map-is/m-p/41303#M3538</guid>
      <dc:creator>DerekMiller</dc:creator>
      <dc:date>2012-11-21T20:42:47Z</dc:date>
    </item>
  </channel>
</rss>

