<?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 and the ID column</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/sorting-and-the-id-column</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-and-the-id-column/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>slimjim96 on Sorting and the ID column</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/sorting-and-the-id-column#p25467</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/sorting-and-the-id-column#p25467</guid>
        	        	<description><![CDATA[<p>Whenever a column is selected to be sorted (including the ID column) and the ID column does not contain consecutive numbers, it re-numbers them.</p>
</p>
<p>For example, if we have ids listed as 1, 4, 7, 9, 10. After sorting they get changed to 1, 2, 3, 4, 5.</p>
</p>
<p>For users who use the id column to represent the IDs in a database, create a second "hidden_id" column and enter them as strings. When referencing them, use the "hidden_id" attribute to get the correct id.</p>
<p>$("#GRID_LIST_ID").jqGrid({</p>
<p>...</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; data: { id:&#60;%=item.getId()%&#62;, hidden_id:"&#60;%=item.getId()%&#62;"...},</p>
<p>onSelectRow: function(id){</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if(id) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var ret = $("#GRID_LIST_ID").getRowData(id);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; window.location.href = "page_edit.jsp?edit="+ret.hidden_id;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
</p>
<p>...</p>
</p>
<p>}):</p>
</p>
<p>Thanks for your time and overall a great plugin.</p>
</p>
<p>Jim</p>
]]></description>
        	        	<pubDate>Mon, 19 Dec 2011 17:31:44 +0200</pubDate>
        </item>
</channel>
</rss>