<?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 woes</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/sorting-woes</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/help/sorting-woes/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>jakemonO on sorting woes</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/sorting-woes#p19389</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/sorting-woes#p19389</guid>
        	        	<description><![CDATA[<p>I&#39;m using jqGrid 3.7.2. to display data retrieved as JSON from a DWR call. The grid displays flawlessy, but I can&#39;t seeem to get it to do client-side sorting no matter what I try. Am I to understand that the grid doesn&#39;t sort on remote data? I&#39;m returning a complete result set that is displayed in 1 page and all I want to do is sort what&#39;s being displayed in the grid when a user clicks on the column header. Here&#39;s my colModel:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4738' value='Select Code' data-codeid='sfcode4738' /></p>
<div class='sfcode' id='sfcode4738'>colModelDef = [<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;id&#39;,label:&#39;id&#39;,hidden: true, key: true},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;nodeType&#39;,label:&#39;Action&#39;,width:75, key: true, sortable: false},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;date&#39;,label:&#39;Effective Date&#39;,width:100, sortable: true, sorttype: &#39;date&#39;, formatter:&#39;date&#39;},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;location&#39;,label:&#39;Location&#39;,width:150, key: true, sortable: true, sorttype: &#39;text&#39;},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;quantity&#39;,label:&#39;Quantity&#39;,width:70, sorttype: &#39;int&#39;},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;reason&#39;,label:&#39;Reason&#39;,width:200},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;comment&#39;,label:&#39;Comments&#39;,width:400}&#160;&#160;&#160;&#160; &#160;<br />]; &#160;</div>
<p>with DWR, I essentially call make the remote call, retrieve the JSON and execute the callback which massages the retrieved data and executes</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8827' value='Select Code' data-codeid='sfcode8827' /></p>
<div class='sfcode' id='sfcode8827'>$(&#34;.<em>tableName</em>&#34;)[0].addJSONData(tableData)</div>
<p>My Grid function is:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3672' value='Select Code' data-codeid='sfcode3672' /></p>
<div class='sfcode' id='sfcode3672'>&#160; $(&#34;.<em>tableName</em>&#34;).jqGrid({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype: doFetch(postdata),<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colModel: colModelDef,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jsonReader: {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; repeatitems: false<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ondblClickRow: function() {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; row_id = $(&#34;.<em>tableName</em>&#34;).getGridParam(&#39;selrow&#39;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; editNode(row_id)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortname: &#39;date&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortorder: &#39;desc&#39;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; })</p>
</div>
<p>Pray tell, what am I missing to get this to sort on the client?</p>
</p>
<p>Thanks in adv.</p>
]]></description>
        	        	<pubDate>Fri, 27 Aug 2010 20:14:40 +0300</pubDate>
        </item>
</channel>
</rss>