<?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: How to Place New Items to beginning of a Dojo Data Grid / Data Store in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-place-new-items-to-beginning-of-a-dojo-data/m-p/451280#M41691</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;So I have a search function that populates the a Datagrid through it's data store and a manual selection tool that adds or removes items from the grid.&amp;nbsp; Items are added with: &lt;STRONG&gt;data_store.newItem(data);&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;The add function places the new items at the end of the grid.&amp;nbsp; I would like this new entry to populate the new item at the top of the grid.&amp;nbsp; Since I am using the data store and not an array, I can't use a function like unshift to place at the beginning of the array.&amp;nbsp; I thought I had seen someone on these forums solve this before, but I can't find the post.&amp;nbsp; Ideas anyone?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you tried using sort based on a predictable property?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you don't have a great property to sort on, you could have a hidden property that acts as a sorting mechanism for new items added to the store. All older items might have sort=1, while items you've added to the store recently have sort=0, and you'd sort your store based on that hidden field. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Last question, have you tried using dgrid over datagrid? It's far far easier to use and included in the ESRI JSAPI.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Dec 2013 15:08:45 GMT</pubDate>
    <dc:creator>JonathanUihlein</dc:creator>
    <dc:date>2013-12-18T15:08:45Z</dc:date>
    <item>
      <title>How to Place New Items to beginning of a Dojo Data Grid / Data Store</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-place-new-items-to-beginning-of-a-dojo-data/m-p/451279#M41690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So I have a search function that populates the a Datagrid through it's data store and a manual selection tool that adds or removes items from the grid.&amp;nbsp; Items are added with: &lt;/SPAN&gt;&lt;STRONG&gt;data_store.newItem(data);&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The add function places the new items at the end of the grid.&amp;nbsp; I would like this new entry to populate the new item at the top of the grid.&amp;nbsp; Since I am using the data store and not an array, I can't use a function like unshift to place at the beginning of the array.&amp;nbsp; I thought I had seen someone on these forums solve this before, but I can't find the post.&amp;nbsp; Ideas anyone?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2013 12:58:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-place-new-items-to-beginning-of-a-dojo-data/m-p/451279#M41690</guid>
      <dc:creator>ThomasHynes</dc:creator>
      <dc:date>2013-12-18T12:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to Place New Items to beginning of a Dojo Data Grid / Data Store</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-place-new-items-to-beginning-of-a-dojo-data/m-p/451280#M41691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;So I have a search function that populates the a Datagrid through it's data store and a manual selection tool that adds or removes items from the grid.&amp;nbsp; Items are added with: &lt;STRONG&gt;data_store.newItem(data);&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;The add function places the new items at the end of the grid.&amp;nbsp; I would like this new entry to populate the new item at the top of the grid.&amp;nbsp; Since I am using the data store and not an array, I can't use a function like unshift to place at the beginning of the array.&amp;nbsp; I thought I had seen someone on these forums solve this before, but I can't find the post.&amp;nbsp; Ideas anyone?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you tried using sort based on a predictable property?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you don't have a great property to sort on, you could have a hidden property that acts as a sorting mechanism for new items added to the store. All older items might have sort=1, while items you've added to the store recently have sort=0, and you'd sort your store based on that hidden field. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Last question, have you tried using dgrid over datagrid? It's far far easier to use and included in the ESRI JSAPI.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2013 15:08:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-place-new-items-to-beginning-of-a-dojo-data/m-p/451280#M41691</guid>
      <dc:creator>JonathanUihlein</dc:creator>
      <dc:date>2013-12-18T15:08:45Z</dc:date>
    </item>
  </channel>
</rss>

