<?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: Can the features in the 3.x Popup window be sorted? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-features-in-the-3-x-popup-window-be-sorted/m-p/657888#M61372</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;You are sorting the array after the fact. You need to override the setFeatures method and sort the array before the setFeatures method applies the array.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Jan 2018 22:23:55 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2018-01-11T22:23:55Z</dc:date>
    <item>
      <title>Can the features in the 3.x Popup window be sorted?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-features-in-the-3-x-popup-window-be-sorted/m-p/657885#M61369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If we have a feature class where multiple features overlap each over, is there anyway to sort the features shown in the infowindow popup?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, if we have multiple point features representing different 3-1-1 calls that overlap each other on the map, is there anyway to enforce an ordering so that when the map is clicked, the newest feature, based on a timestamp column, is shown first ? So that the newest record is 1 of X, the second oldest is 2 of X etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that the ordering of item in the popup window is random.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried adding code to the "set-features" event handler to sort the features, but this did not make any differenct&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jan 2018 21:53:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-features-in-the-3-x-popup-window-be-sorted/m-p/657885#M61369</guid>
      <dc:creator>DavidFriedrich</dc:creator>
      <dc:date>2018-01-11T21:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: Can the features in the 3.x Popup window be sorted?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-features-in-the-3-x-popup-window-be-sorted/m-p/657886#M61370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;David&lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I tried adding code to the "set-features" event handler to sort the features, but this did not make any difference&lt;/BLOCKQUOTE&gt;&lt;P&gt;What exactly did you try, because this is the only way to manage the order is to set the order of the setFeatures array?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jan 2018 22:09:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-features-in-the-3-x-popup-window-be-sorted/m-p/657886#M61370</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-01-11T22:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Can the features in the 3.x Popup window be sorted?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-features-in-the-3-x-popup-window-be-sorted/m-p/657887#M61371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;in the "set-features" event-handler, I added some code like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;var data = _map.infoWindow.features;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; if (data &amp;amp;&amp;amp; data.length &amp;gt; 0) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;data.sort(function (a, b) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (a.LayerSortKey &amp;amp;&amp;amp; b.LayerSortKey) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (a.LayerSortKey &amp;gt; b.LayerSortKey) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; &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 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; &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;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (a.LayerSortKey &amp;lt; b.LayerSortKey) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; &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 -1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;data.reverse();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(LayerSortKey is an attribute I have on the feature class that I wish to use for sorting)&lt;/P&gt;&lt;P&gt;It seems to sort the array of _map.infoWindow.features, but the order that they appear in the popup seems to be random&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jan 2018 22:16:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-features-in-the-3-x-popup-window-be-sorted/m-p/657887#M61371</guid>
      <dc:creator>DavidFriedrich</dc:creator>
      <dc:date>2018-01-11T22:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: Can the features in the 3.x Popup window be sorted?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-features-in-the-3-x-popup-window-be-sorted/m-p/657888#M61372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;You are sorting the array after the fact. You need to override the setFeatures method and sort the array before the setFeatures method applies the array.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jan 2018 22:23:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-features-in-the-3-x-popup-window-be-sorted/m-p/657888#M61372</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-01-11T22:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: Can the features in the 3.x Popup window be sorted?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-features-in-the-3-x-popup-window-be-sorted/m-p/657889#M61373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That seems to work, thank you Robert!&lt;/P&gt;&lt;P&gt;One more thing that seemed to be necessary - I had to override the "show" method and change the "closestFirst" parameter to false.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jan 2018 00:36:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-features-in-the-3-x-popup-window-be-sorted/m-p/657889#M61373</guid>
      <dc:creator>DavidFriedrich</dc:creator>
      <dc:date>2018-01-12T00:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: Can the features in the 3.x Popup window be sorted?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-features-in-the-3-x-popup-window-be-sorted/m-p/657890#M61374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;The community would definitely benefit if you would post the code you end up using.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jan 2018 14:39:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-features-in-the-3-x-popup-window-be-sorted/m-p/657890#M61374</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-01-12T14:39:41Z</dc:date>
    </item>
  </channel>
</rss>

