<?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: Sorting an infotable in ascending order in ThingWorx Developers</title>
    <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Sorting-an-infotable-in-ascending-order/m-p/754389#M55027</link>
    <description>&lt;DIV class="page"&gt;&lt;DIV class="layoutArea"&gt;&lt;DIV class="column"&gt;&lt;P&gt;&lt;SPAN&gt;Hi kahmeng96,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I know you already have a solution, but this might be an alternative...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//The code below sorts an infotable by the specified column.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var result = Resources["InfoTableFunctions"].Sort( &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;sortColumn: "LegReaction", t: myInfoTable, ascending: true &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;} );&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 22 Oct 2021 11:00:02 GMT</pubDate>
    <dc:creator>DuanGauche</dc:creator>
    <dc:date>2021-10-22T11:00:02Z</dc:date>
    <item>
      <title>Sorting an infotable in ascending order</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Sorting-an-infotable-in-ascending-order/m-p/630314#M39783</link>
      <description>&lt;P&gt;Hi all, I am trying to sort an infotable in ascending order of a column, in this case the LegReaction column.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 309px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/19963i761A2E720942756D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;As shown in the infotable above, I want to put the value of LegReaction (45)&amp;nbsp;between values 40 and 50 without manually modifying the infotable but by JavaScript programming. Any help is greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 06:43:20 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Sorting-an-infotable-in-ascending-order/m-p/630314#M39783</guid>
      <dc:creator>kahmeng96</dc:creator>
      <dc:date>2019-10-09T06:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting an infotable in ascending order</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Sorting-an-infotable-in-ascending-order/m-p/630322#M39788</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should follow algorithm to insert object in a sorted array:&amp;nbsp;&lt;A href="https://www.geeksforgeeks.org/search-insert-and-delete-in-a-sorted-array/" target="_blank"&gt;https://www.geeksforgeeks.org/search-insert-and-delete-in-a-sorted-array/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Sorry, I don't have the code but this is the idea, implement the inserting operation in infotable via a service following the above algorithm.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Workaround: add a row in infotable, doesn't matter the position and then use the Sort function:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Resources["InfoTableFunctions"].Sort(params)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope it helps,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Raluca Edu&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 07:21:31 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Sorting-an-infotable-in-ascending-order/m-p/630322#M39788</guid>
      <dc:creator>raluca_edu</dc:creator>
      <dc:date>2019-10-09T07:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting an infotable in ascending order</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Sorting-an-infotable-in-ascending-order/m-p/630323#M39789</link>
      <description>&lt;P&gt;Hi all, I have found the solution by tinkering with the sort function&lt;/P&gt;
&lt;P&gt;data.sort(function(a, b){return a.LegReaction-b.LegReaction});&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 07:21:49 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Sorting-an-infotable-in-ascending-order/m-p/630323#M39789</guid>
      <dc:creator>kahmeng96</dc:creator>
      <dc:date>2019-10-09T07:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting an infotable in ascending order</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Sorting-an-infotable-in-ascending-order/m-p/630331#M39793</link>
      <description>&lt;P&gt;Thanks for the advice,&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/287239"&gt;@raluca_edu&lt;/a&gt;! However, I found an easier solution which is the I accepted as the solution to my question.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 07:43:11 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Sorting-an-infotable-in-ascending-order/m-p/630331#M39793</guid>
      <dc:creator>kahmeng96</dc:creator>
      <dc:date>2019-10-09T07:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting an infotable in ascending order</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Sorting-an-infotable-in-ascending-order/m-p/630332#M39794</link>
      <description>&lt;P&gt;You welcome! I saw your post after. Good luck!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 07:45:59 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Sorting-an-infotable-in-ascending-order/m-p/630332#M39794</guid>
      <dc:creator>raluca_edu</dc:creator>
      <dc:date>2019-10-09T07:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting an infotable in ascending order</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Sorting-an-infotable-in-ascending-order/m-p/754389#M55027</link>
      <description>&lt;DIV class="page"&gt;&lt;DIV class="layoutArea"&gt;&lt;DIV class="column"&gt;&lt;P&gt;&lt;SPAN&gt;Hi kahmeng96,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I know you already have a solution, but this might be an alternative...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//The code below sorts an infotable by the specified column.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var result = Resources["InfoTableFunctions"].Sort( &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;sortColumn: "LegReaction", t: myInfoTable, ascending: true &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;} );&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 22 Oct 2021 11:00:02 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Sorting-an-infotable-in-ascending-order/m-p/754389#M55027</guid>
      <dc:creator>DuanGauche</dc:creator>
      <dc:date>2021-10-22T11:00:02Z</dc:date>
    </item>
  </channel>
</rss>

