<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: sortArrayData - will not reverse sorting?</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/sortarraydata-will-not-reverse-sorting</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/bugs/sortarraydata-will-not-reverse-sorting/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on sortArrayData - will not reverse sorting?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/sortarraydata-will-not-reverse-sorting#p14815</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/sortarraydata-will-not-reverse-sorting#p14815</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Already done in GitHub</p>
<p><a href="http://github.com/tonytomov/jqGrid/commit/a4f3a6491ce7c77c05fb89cf64c36edcd50b0c9c" rel="nofollow" target="_blank"><a href="http://github.com/tonytomov/jq" rel="nofollow">http://github.com/tonytomov/jq</a>.....dcd50b0c9c</a></p>
<p>Thanks.</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Mon, 15 Feb 2010 16:04:26 +0200</pubDate>
        </item>
        <item>
        	<title>Les on sortArrayData - will not reverse sorting?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/sortarraydata-will-not-reverse-sorting#p14814</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/sortarraydata-will-not-reverse-sorting#p14814</guid>
        	        	<description><![CDATA[<p>I wanted to add more detail. &#160;When I click consecutively on the column header to sort grid data, &#160;the code below inside sortData()&#160;is called.</p>
</p>
<div id="sb6-L892" class="sourceRow">
<p><input type='button' class='sfcodeselect' name='sfselectit4442' value='Select Code' data-codeid='sfcode4442' /></p>
<div class='sfcode' id='sfcode4442'>
<div id=&#34;sb6-L892&#34; class=&#34;sourceRow&#34;>rows.sort(function(a, b) {</div>
<div id="sb6-L893" class="sourceRow "><span style="white-space: pre;"> </span>if  (a.sortKey &#60; b.sortKey) {return -newDir;}</div>
<div id="sb6-L894" class="sourceRow"><span style="white-space: pre;"> </span>if  (a.sortKey &#62; b.sortKey) {return newDir;}</div>
<div id="sb6-L895" class="sourceRow "><span style="white-space: pre;"> </span>return 0;</div>
<div id="sb6-L896" class="sourceRow">});&#160;</div>
</div>
</div>
<p>This code is not efficient because it sorts an already sorted array. &#160;When the array is sorted and we want to sort it (on the client) in reverse order (by clicking on the same column header), the rows.reverse() method should be used.</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1791' value='Select Code' data-codeid='sfcode1791' /></p>
<div class='sfcode' id='sfcode1791'>rows.reverse()</div>
]]></description>
        	        	<pubDate>Mon, 15 Feb 2010 15:50:23 +0200</pubDate>
        </item>
        <item>
        	<title>Les on sortArrayData - will not reverse sorting?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/sortarraydata-will-not-reverse-sorting#p14794</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/sortarraydata-will-not-reverse-sorting#p14794</guid>
        	        	<description><![CDATA[<p>I believe there&#39;s an inefficiency in the sortArrayData() function. &#160;This method is not reversing results of an already sorted array, but it instead it sorts it again.</p>
<p>Reversing an already sorted array is much faster, so the rows.reverse() method should be used when rows are sorted and we want to reverse the order.</p></p>
]]></description>
        	        	<pubDate>Sun, 14 Feb 2010 15:40:02 +0200</pubDate>
        </item>
</channel>
</rss>