<?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: Sorting bug in 3.7.1?</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/sorting-bug-in-3-7-1</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/sorting-bug-in-3-7-1/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>gal_ga on Sorting bug in 3.7.1?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/sorting-bug-in-3-7-1#p18088</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/sorting-bug-in-3-7-1#p18088</guid>
        	        	<description><![CDATA[<p>Hi Paul,</p>
</p>
<p>Sorry for being "pushed" here.</p>
<p>Tony replied yours post and asked me to open my issue in different post.</p>
</p>
<p>Cheers,</p>
<p>Gal</p>
]]></description>
        	        	<pubDate>Sun, 20 Jun 2010 16:39:59 +0300</pubDate>
        </item>
        <item>
        	<title>Fatal on Sorting bug in 3.7.1?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/sorting-bug-in-3-7-1#p18087</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/sorting-bug-in-3-7-1#p18087</guid>
        	        	<description><![CDATA[<p>hi tony,</p>
</p>
<p>Were you replying to my post or to gal_ga? I&#39;m a bit confused.</p>
</p>
<p>Regardless, I believe that the fix I suggested should work. Could you please look at integrating it into the next revision of jqGrid?</p>
</p>
<p>cheers</p>
<p>Paul.</p>
]]></description>
        	        	<pubDate>Sun, 20 Jun 2010 16:10:16 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Sorting bug in 3.7.1?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/sorting-bug-in-3-7-1#p18085</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/sorting-bug-in-3-7-1#p18085</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Thanks.</p>
<p>Mybe you will need to do</p>
<p>rowNum: 10,</p>
<p>rowTotal : -1</p>
<p>according to the examples for obtaining the data at once and manipulate it locally,</p>
<p>or change the rowNum to value greater than -1 after the grid loads.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sun, 20 Jun 2010 13:30:15 +0300</pubDate>
        </item>
        <item>
        	<title>Fatal on Sorting bug in 3.7.1?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/sorting-bug-in-3-7-1#p18061</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/sorting-bug-in-3-7-1#p18061</guid>
        	        	<description><![CDATA[<p>gal_ga,</p>
</p>
<p>sorry but you have kind of hijacked this thread. perhaps you want to start a new thread to ask questions about your issue. FYI, addRowData still works to add single rows of data.</p>
</p>
<p>tony,</p>
</p>
<p>regarding the sorting issue, I have tracked down the issue to line 1364 in grid.base.js</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3715' value='Select Code' data-codeid='sfcode3715' /></p>
<div class='sfcode' id='sfcode3715'>&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; queryResults = queryResults.slice( (page-1)*recordsperpage , page*recordsperpage );</div>
</p>
<p>In my case, page = 0 and records per page = -1.</p>
</p>
<p>Therefore it is calling queryResults.slice(0, -1) and removing the last element from the array.</p>
</p>
<p>I&#39;m not sure of a better way to do this but possibly just doing:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5137' value='Select Code' data-codeid='sfcode5137' /></p>
<div class='sfcode' id='sfcode5137'>
<p>if( recordsperpage != -1 )</p>
<p>{<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; queryResults = queryResults.slice( (page-1)*recordsperpage ,  page*recordsperpage );</p>
<p>}</p>
</div>
<p>will solve it.</p>
]]></description>
        	        	<pubDate>Sun, 20 Jun 2010 11:14:33 +0300</pubDate>
        </item>
        <item>
        	<title>gal_ga on Sorting bug in 3.7.1?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/sorting-bug-in-3-7-1#p18039</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/sorting-bug-in-3-7-1#p18039</guid>
        	        	<description><![CDATA[<p>Just to be sure I got you right. do you mean that a code like this:</p>
<p>for(var i=0;i&#60;=mydata.length;i++) {</p>
<p>&#160;&#160;&#160; jQuery("#list4&#8243;).jqGrid(&#39;addRowData&#39;,i+1,mydata[i]);</p>
<p>}</p>
</p>
<p>Which used to work, is no longer supported?</p>
]]></description>
        	        	<pubDate>Sun, 20 Jun 2010 09:45:01 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Sorting bug in 3.7.1?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/sorting-bug-in-3-7-1#p18033</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/sorting-bug-in-3-7-1#p18033</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Sorry, I do not see other way</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sun, 20 Jun 2010 09:22:04 +0300</pubDate>
        </item>
        <item>
        	<title>gal_ga on Sorting bug in 3.7.1?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/sorting-bug-in-3-7-1#p17947</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/sorting-bug-in-3-7-1#p17947</guid>
        	        	<description><![CDATA[<p>Hi Tony,</p>
</p>
<p>I also have issues with the use of:</p>
<p>for(var i=0;i&#60;=mydata.length;i++){</p>
<p>jQuery("#list4&#8243;).jqGrid(&#39;addRowData&#39;,i+1,mydata[i]);</p>
<p>}</p>
</p>
<p>Even if there is a better way in 3.7.x - I still have an old code which does it and currently prefer not to modify.</p></p>
]]></description>
        	        	<pubDate>Wed, 16 Jun 2010 12:25:58 +0300</pubDate>
        </item>
        <item>
        	<title>Fatal on Sorting bug in 3.7.1?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/sorting-bug-in-3-7-1#p17945</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/sorting-bug-in-3-7-1#p17945</guid>
        	        	<description><![CDATA[<p>Thanks for the suggestion Tony.</p>
</p>
<p>For the purposes of demonstrating this bug, i just took one of the jqgrid demos and modified it.</p>
</p>
<p>In my real code, the data is not available at the time of constructing the grid however i do pass it all to addRowData() in 1 method call, rather than in a loop as is shown in this code.</p>
</p>
<p>I hope you manage to find the issue 🙂</p>
]]></description>
        	        	<pubDate>Wed, 16 Jun 2010 09:50:12 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Sorting bug in 3.7.1?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/sorting-bug-in-3-7-1#p17944</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/sorting-bug-in-3-7-1#p17944</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>It is not a good idea in this case to use addRowData.</p>
<p>Also you can simple replace</p>
</p>
<p>for(var i=0;i&#60;=mydata.length;i++)</p>
<p>jQuery("#list4").jqGrid(&#39;addRowData&#39;,i+1,mydata[i]);</p>
<p>with</p>
</p>
<p>jQuery("#list4").jqGrid({</p>
<p>datatype: "local",</p>
<p>data : mydata,</p>
<p>...</p>
<p>});</p>
<p>It is a more natural way to have paging.</p>
<p>Instead I will check your example.</p>
<p>Best Regards.</p></p>
]]></description>
        	        	<pubDate>Wed, 16 Jun 2010 09:36:28 +0300</pubDate>
        </item>
        <item>
        	<title>Fatal on Sorting bug in 3.7.1?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/sorting-bug-in-3-7-1#p17942</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/sorting-bug-in-3-7-1#p17942</guid>
        	        	<description><![CDATA[<p>Doing some more research, I notice the &#39;rowNum&#39; property on the grid that defaults to 20.</p>
</p>
<p>If i add a property -</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1642' value='Select Code' data-codeid='sfcode1642' /></p>
<div class='sfcode' id='sfcode1642'>rowNum: -1</div>
<p>, it now displays rows 29 down to 2 or rows 1 down to 28, depending on the sort order with version 3.7.1.&#160; On version 3.6.5, it displays all rows (29-1 / 1-29) correctly.</p>
</p>
<p>So, even with the property added:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit348' value='Select Code' data-codeid='sfcode348' /></p>
<div class='sfcode' id='sfcode348'>rowNum: -1</div>
<p>there is still an &#39;off by 1&#39; issue in the sorting code in 3.7.1, by the looks of it.</p>
]]></description>
        	        	<pubDate>Wed, 16 Jun 2010 06:12:22 +0300</pubDate>
        </item>
        <item>
        	<title>Fatal on Sorting bug in 3.7.1?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/sorting-bug-in-3-7-1#p17941</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/sorting-bug-in-3-7-1#p17941</guid>
        	        	<description><![CDATA[<p>I am having an issue with sorting since upgrading from version 3.6.5 to version 3.7.1. Basically the data in the grid is being truncated to 20 items. I do not have paging configured for the grid.</p>
</p>
<p>The code below should demonstrate my issue. Notice when you click the sort button that the ids either go from 29 down to 10 or from 1 up to 20, depending on the sort order.</p>
</p>
<p>This behaviour is different to version 3.6.5. Is there an additional property that i can configure to get the behaviour from 3.6.5 where all rows would be displayed?</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit6396' value='Select Code' data-codeid='sfcode6396' /></p>
<div class='sfcode' id='sfcode6396'>
<p>&#60;html&#62;</p>
</p>
<p>&#60;head&#62;</p>
<p>&#60;script src=&#34;js/jquery-1.4.2.min.js&#34; type=&#34;text/javascript&#34;&#62;</p>
<p>&#60;/script&#62;</p>
<p>&#60;script src=&#34;js/jquery.jqGrid.min.js&#34; type=&#34;text/javascript&#34;&#62;</p>
<p>&#60;/script&#62;</p>
<p>&#60;link rel=&#34;stylesheet&#34; href=&#34;css/ui.jqgrid.css&#34;/&#62;</p>
<p>&#60;/head&#62;</p>
<p>&#60;body&#62;</p>
<p>&#60;script type=&#34;text/javascript&#34;&#62;</p>
<p>$(function() {</p>
</p>
<p>jQuery(&#34;#list4&#34;).jqGrid({</p>
<p>datatype: &#34;local&#34;,</p>
<p>height: 250,</p>
<p>colNames:[&#39;Inv No&#39;,&#39;Client&#39;],</p>
<p>colModel:[</p>
<p>{name:&#39;id&#39;,index:&#39;id&#39;, width:60, sorttype:&#34;int&#34;},</p>
<p>{name:&#39;name&#39;,index:&#39;name&#39;, width:100},</p>
<p>],</p>
<p>caption: &#34;Manipulating Array Data&#34; });</p>
<p>var mydata = [</p>
<p>{id:&#34;1&#34;,invdate:&#34;2007-10-01&#34;,name:&#34;test&#34;,note:&#34;note&#34;,amount:&#34;200.00&#34;,tax:&#34;10.00&#34;,total:&#34;210.00&#34;},</p>
<p>{id:&#34;2&#34;,invdate:&#34;2007-10-02&#34;,name:&#34;test2&#34;,note:&#34;note2&#34;,amount:&#34;300.00&#34;,tax:&#34;20.00&#34;,total:&#34;320.00&#34;},</p>
<p>{id:&#34;3&#34;,invdate:&#34;2007-09-01&#34;,name:&#34;test3&#34;,note:&#34;note3&#34;,amount:&#34;400.00&#34;,tax:&#34;30.00&#34;,total:&#34;430.00&#34;},</p>
<p>{id:&#34;4&#34;,invdate:&#34;2007-10-04&#34;,name:&#34;test&#34;,note:&#34;note&#34;,amount:&#34;200.00&#34;,tax:&#34;10.00&#34;,total:&#34;210.00&#34;},</p>
<p>{id:&#34;5&#34;,invdate:&#34;2007-10-05&#34;,name:&#34;test2&#34;,note:&#34;note2&#34;,amount:&#34;300.00&#34;,tax:&#34;20.00&#34;,total:&#34;320.00&#34;},</p>
<p>{id:&#34;6&#34;,invdate:&#34;2007-09-06&#34;,name:&#34;test3&#34;,note:&#34;note3&#34;,amount:&#34;400.00&#34;,tax:&#34;30.00&#34;,total:&#34;430.00&#34;},</p>
<p>{id:&#34;7&#34;,invdate:&#34;2007-10-04&#34;,name:&#34;test&#34;,note:&#34;note&#34;,amount:&#34;200.00&#34;,tax:&#34;10.00&#34;,total:&#34;210.00&#34;},</p>
<p>{id:&#34;8&#34;,invdate:&#34;2007-10-03&#34;,name:&#34;test2&#34;,note:&#34;note2&#34;,amount:&#34;300.00&#34;,tax:&#34;20.00&#34;,total:&#34;320.00&#34;},</p>
<p>{id:&#34;9&#34;,invdate:&#34;2007-09-01&#34;,name:&#34;test3&#34;,note:&#34;note3&#34;,amount:&#34;400.00&#34;,tax:&#34;30.00&#34;,total:&#34;430.00&#34;} ,</p>
<p>{id:&#34;10&#34;,invdate:&#34;2007-09-01&#34;,name:&#34;test3&#34;,note:&#34;note4&#34;,amount:&#34;400.00&#34;,tax:&#34;30.00&#34;,total:&#34;430.00&#34;} ,</p>
<p>{id:&#34;11&#34;,invdate:&#34;2007-10-01&#34;,name:&#34;test&#34;,note:&#34;note&#34;,amount:&#34;200.00&#34;,tax:&#34;10.00&#34;,total:&#34;210.00&#34;},</p>
<p>{id:&#34;12&#34;,invdate:&#34;2007-10-02&#34;,name:&#34;test2&#34;,note:&#34;note2&#34;,amount:&#34;300.00&#34;,tax:&#34;20.00&#34;,total:&#34;320.00&#34;},</p>
<p>{id:&#34;13&#34;,invdate:&#34;2007-09-01&#34;,name:&#34;test3&#34;,note:&#34;note3&#34;,amount:&#34;400.00&#34;,tax:&#34;30.00&#34;,total:&#34;430.00&#34;},</p>
<p>{id:&#34;14&#34;,invdate:&#34;2007-10-04&#34;,name:&#34;test&#34;,note:&#34;note&#34;,amount:&#34;200.00&#34;,tax:&#34;10.00&#34;,total:&#34;210.00&#34;},</p>
<p>{id:&#34;15&#34;,invdate:&#34;2007-10-05&#34;,name:&#34;test2&#34;,note:&#34;note2&#34;,amount:&#34;300.00&#34;,tax:&#34;20.00&#34;,total:&#34;320.00&#34;},</p>
<p>{id:&#34;16&#34;,invdate:&#34;2007-09-06&#34;,name:&#34;test3&#34;,note:&#34;note3&#34;,amount:&#34;400.00&#34;,tax:&#34;30.00&#34;,total:&#34;430.00&#34;},</p>
<p>{id:&#34;17&#34;,invdate:&#34;2007-10-04&#34;,name:&#34;test&#34;,note:&#34;note&#34;,amount:&#34;200.00&#34;,tax:&#34;10.00&#34;,total:&#34;210.00&#34;},</p>
<p>{id:&#34;18&#34;,invdate:&#34;2007-10-03&#34;,name:&#34;test2&#34;,note:&#34;note2&#34;,amount:&#34;300.00&#34;,tax:&#34;20.00&#34;,total:&#34;320.00&#34;},</p>
<p>{id:&#34;19&#34;,invdate:&#34;2007-09-01&#34;,name:&#34;test3&#34;,note:&#34;note3&#34;,amount:&#34;400.00&#34;,tax:&#34;30.00&#34;,total:&#34;430.00&#34;} ,</p>
<p>{id:&#34;20&#34;,invdate:&#34;2007-09-01&#34;,name:&#34;test3&#34;,note:&#34;note4&#34;,amount:&#34;400.00&#34;,tax:&#34;30.00&#34;,total:&#34;430.00&#34;} ,</p>
<p>{id:&#34;21&#34;,invdate:&#34;2007-10-01&#34;,name:&#34;test&#34;,note:&#34;note&#34;,amount:&#34;200.00&#34;,tax:&#34;10.00&#34;,total:&#34;210.00&#34;},</p>
<p>{id:&#34;22&#34;,invdate:&#34;2007-10-02&#34;,name:&#34;test2&#34;,note:&#34;note2&#34;,amount:&#34;300.00&#34;,tax:&#34;20.00&#34;,total:&#34;320.00&#34;},</p>
<p>{id:&#34;23&#34;,invdate:&#34;2007-09-01&#34;,name:&#34;test3&#34;,note:&#34;note3&#34;,amount:&#34;400.00&#34;,tax:&#34;30.00&#34;,total:&#34;430.00&#34;},</p>
<p>{id:&#34;24&#34;,invdate:&#34;2007-10-04&#34;,name:&#34;test&#34;,note:&#34;note&#34;,amount:&#34;200.00&#34;,tax:&#34;10.00&#34;,total:&#34;210.00&#34;},</p>
<p>{id:&#34;25&#34;,invdate:&#34;2007-10-05&#34;,name:&#34;test2&#34;,note:&#34;note2&#34;,amount:&#34;300.00&#34;,tax:&#34;20.00&#34;,total:&#34;320.00&#34;},</p>
<p>{id:&#34;26&#34;,invdate:&#34;2007-09-06&#34;,name:&#34;test3&#34;,note:&#34;note3&#34;,amount:&#34;400.00&#34;,tax:&#34;30.00&#34;,total:&#34;430.00&#34;},</p>
<p>{id:&#34;27&#34;,invdate:&#34;2007-10-04&#34;,name:&#34;test&#34;,note:&#34;note&#34;,amount:&#34;200.00&#34;,tax:&#34;10.00&#34;,total:&#34;210.00&#34;},</p>
<p>{id:&#34;28&#34;,invdate:&#34;2007-10-03&#34;,name:&#34;test2&#34;,note:&#34;note2&#34;,amount:&#34;300.00&#34;,tax:&#34;20.00&#34;,total:&#34;320.00&#34;},</p>
<p>{id:&#34;29&#34;,invdate:&#34;2007-09-01&#34;,name:&#34;test3&#34;,note:&#34;note3&#34;,amount:&#34;400.00&#34;,tax:&#34;30.00&#34;,total:&#34;430.00&#34;}</p>
<p>];</p>
</p>
<p>for(var i=0;i&#60;=mydata.length;i++)</p>
<p>jQuery(&#34;#list4&#34;).jqGrid(&#39;addRowData&#39;,i+1,mydata[i]);</p>
</p>
<p>$(&#39;#mybutton&#39;).click(function() {</p>
<p>$(&#39;#list4&#39;).jqGrid(&#39;sortGrid&#39;,&#39;id&#39;,false);</p>
<p>});</p>
<p>});</p>
<p>&#60;/script&#62;</p>
<p>&#60;button id=&#34;mybutton&#34;&#62;Click to Sort&#60;/button&#62;</p>
<p>&#60;table id=&#34;list4&#34;&#62;&#60;/table&#62;</p>
<p>&#60;/body&#62;</p>
<p>&#60;/html&#62;</p>
</div>
]]></description>
        	        	<pubDate>Wed, 16 Jun 2010 05:44:32 +0300</pubDate>
        </item>
</channel>
</rss>