<?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: client side JSON and SortGrid behaving oddly!</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/client-side-json-and-sortgrid-behaving-oddly</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/client-side-json-and-sortgrid-behaving-oddly/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>thor78 on client side JSON and SortGrid behaving oddly!</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/client-side-json-and-sortgrid-behaving-oddly#p4588</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/client-side-json-and-sortgrid-behaving-oddly#p4588</guid>
        	        	<description><![CDATA[<p>Any eta on upcoming release that will include this bug fix?</p>
<p>Thanks,<br />Thor.&#160;</p>
]]></description>
        	        	<pubDate>Thu, 12 Feb 2009 12:05:39 +0200</pubDate>
        </item>
        <item>
        	<title>tony on client side JSON and SortGrid behaving oddly!</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/client-side-json-and-sortgrid-behaving-oddly#p4476</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/client-side-json-and-sortgrid-behaving-oddly#p4476</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Thanks - it is really a bug. I fixed this. Also in the code I make comparations only for datatype local and not for clientSide.</p>
<p>Also to correct quick a bug here is the code:</p>
<p>&#160;case "local":<br />&#160;case "clientSide":<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; ts.p.datatype = "local";<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; sortArrayData();<br />Tony</p>
]]></description>
        	        	<pubDate>Fri, 06 Feb 2009 10:32:45 +0200</pubDate>
        </item>
        <item>
        	<title>thor78 on client side JSON and SortGrid behaving oddly!</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/client-side-json-and-sortgrid-behaving-oddly#p4475</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/client-side-json-and-sortgrid-behaving-oddly#p4475</guid>
        	        	<description><![CDATA[<p>I just fixed this for me - in the populate method I only made the clientSide call the sortArrayData and the local doesnt do anything: &#160;(you had both call sort). &#160;If there is really no difference for these two in your code, you might want to have the local behave like this?</p>
</p>
<p>case "clientSide":</p>
<p><span> </span>sortArrayData();</p>
<p><span> </span>break;</p>
<p><span> </span>case "local":</p>
<p><span> </span>break;</p>
]]></description>
        	        	<pubDate>Fri, 06 Feb 2009 10:16:02 +0200</pubDate>
        </item>
        <item>
        	<title>thor78 on client side JSON and SortGrid behaving oddly!</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/client-side-json-and-sortgrid-behaving-oddly#p4474</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/client-side-json-and-sortgrid-behaving-oddly#p4474</guid>
        	        	<description><![CDATA[<p>Thanks for your reply Tony.</p>
<p>After looking again at the code, I might have misdiagnosed. &#160;Anyway, the main problem I&#180;m having is that I don&#39;t want the grid to be sorting whenever I click the arrows or the header columns. &#160;The thing is, my data fetch takes care of sorting on the server. That way, sorting just those records that are visible on the client does not make any sense. (I still want to get the information from the grid which column the user clicked on, etc.) &#160;If there is any switch where I can turn it off, that would be great, otherwise I probably have to take your code and modify it a bit.</p>
<p>Thanks,</p>
<p>Thor.</p>
]]></description>
        	        	<pubDate>Fri, 06 Feb 2009 10:07:42 +0200</pubDate>
        </item>
        <item>
        	<title>tony on client side JSON and SortGrid behaving oddly!</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/client-side-json-and-sortgrid-behaving-oddly#p4448</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/client-side-json-and-sortgrid-behaving-oddly#p4448</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Could you please point me where is the difference to correct this? Thank you.</p>
<p>Also when you use the date sorting it is a good idea to use the datefmt option to thell the grid what is the format for the date to sort it in right way. The dafault option of datefmt is Y-m-d. Is this your format? If not you will have bad sorting.</p>
<p>Also this is described in the docs: Basic Grid -&#62; Properties-&#62;colModel Properties</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Fri, 06 Feb 2009 03:19:49 +0200</pubDate>
        </item>
        <item>
        	<title>thor78 on client side JSON and SortGrid behaving oddly!</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/client-side-json-and-sortgrid-behaving-oddly#p4438</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/client-side-json-and-sortgrid-behaving-oddly#p4438</guid>
        	        	<description><![CDATA[<p>Hi Tony,</p>
<p>I tried again tonight reading your documentation, and I then started reading your js code&#160;until I figured it out.&#160; What I should have been using is &#39;local&#39; as datatype, not clientSide.&#160;&#160; Your documentation is unclear on when to use which, and it actually states:</p>
<p><em>"First we must instruct jqGrid that the data that will be present is at client side. This is done with the option datatype. To use this we must set </em></p>
<p><em>datatype : <span class="codestring">"clientSide"</span></em></p>
<p><em>The other option that can be used is "local" i.e. datatype: "local" These are the same."</em></p>
<p>However, when digging through your code, I can see that you treat these two quite differently - hence they are not the same! (Besides why would you have the two of them if they were exactly the same 🙂</p>
<p>Anyway,&#160;great job buddy on the grid, but the doc/help is sometimes a bit vague.&#160; I might have some more questions down the road if that&#39;s ok.</p>
<p>Thanks,</p>
<p>Thor.</p>
]]></description>
        	        	<pubDate>Thu, 05 Feb 2009 23:51:13 +0200</pubDate>
        </item>
        <item>
        	<title>thor78 on client side JSON and SortGrid behaving oddly!</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/client-side-json-and-sortgrid-behaving-oddly#p4426</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/client-side-json-and-sortgrid-behaving-oddly#p4426</guid>
        	        	<description><![CDATA[<p>I&#39;ve scoured through documentation, but I cannot find the answer to this.</p>
<p>I&#39;ve actually come across multiple docs online, which one is the best and up to date?</p>
<p>I added the sorttype property, nothing changed.&#160;&#160;I then&#160;changed the sort column to&#160;fullname (string). I get the same strange behavior.</p>
<p>1.&#160;Why doesn&#39;t the addJSONData method sort the grid based on the current grid setting?</p>
<p>2. In the docs it says that sortGrid sorts and shows the sort arrow appropriately. For me it is disappearing.&#160;Bug?</p>
<p>3. When I call sortGrid the little "Loading" message appear. So is it really loading anything or is the message perhaps misleading?</p>
<p>Any help would be appreciated.<br />Thanks,</p>
<p>Thor.</p>
]]></description>
        	        	<pubDate>Thu, 05 Feb 2009 12:55:01 +0200</pubDate>
        </item>
        <item>
        	<title>tony on client side JSON and SortGrid behaving oddly!</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/client-side-json-and-sortgrid-behaving-oddly#p4397</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/client-side-json-and-sortgrid-behaving-oddly#p4397</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Use the sorttype property in colModel. Also refrer to docs.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Thu, 05 Feb 2009 02:31:28 +0200</pubDate>
        </item>
        <item>
        	<title>thor78 on client side JSON and SortGrid behaving oddly!</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/client-side-json-and-sortgrid-behaving-oddly#p4372</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/client-side-json-and-sortgrid-behaving-oddly#p4372</guid>
        	        	<description><![CDATA[<p>Hi Tony,</p>
<p>Great job with the jqGrid! &#160;I do have a question though - I am using this with JSON data and since I don&#39;t want the grid to be making requests (GET/POST) I load my own json data into the grid. &#160;(using addJSONData). &#160;However, for some reason when that happens the grid does not get sorted correctly (im sorting by date), so what I tried was to call the sortGrid right after. &#160;That did work, but now the sort arrow is gone!</p>
<p>Here is my markup/code:</p>
<p>jQuery("#list").jqGrid({</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160;url: &#39;&#39;,</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160;datatype: &#39;clientSide&#39;,</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160;mtype: &#39;POST&#39;,</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160;colNames: [&#39;Id&#39;, &#39;Name&#39;, &#39;Desired Role&#39;, &#39;City&#39;, &#39;State&#39;, &#39;Last Modified&#39;],</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160;colModel: [</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;{ name: &#39;id&#39;, index: &#39;id&#39;, hidden: true },</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;{ name: &#39;fullname&#39;, index: &#39;fullname&#39;, width: 139 },</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;{ name: &#39;desiredrole&#39;, index: &#39;desiredrole&#39;, width: 235 },</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;{ name: &#39;city&#39;, index: &#39;city&#39;, width: 100 },</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;{ name: &#39;state&#39;, index: &#39;state&#39;, width: 50 },</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;{ name: &#39;lastmodifieddisplay&#39;, index: &#39;lastmodified&#39;, width: 100, align: &#39;right&#39;, }, ],</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160;jsonReader: {</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;root: "profiles",</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;page: "curPage",</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;total: "totalPageCount",</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;records: "recordCount",</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;repeatitems: false</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160;},</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160;pager: jQuery(&#39;#pager&#39;),</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160;recordtext: &#39;profiles found&#39;,</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160;rowNum: 10,</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160;rowList: [],</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160;sortname: &#39;lastmodifieddisplay&#39;,</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160;sortorder: "desc",</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160;viewrecords: true,</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160;imgpath: &#39;../../images/jqgrid&#39;,</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160;caption: &#39;&#39;</p>
<p>&#160;&#160; &#160; &#160; &#160;});&#160;</p>
</p>
<p>..and on my button click event I call:</p>
</p>
<p>var mygrid = jQuery("#list")[0];</p>
<p>mygrid.addJSONData(result);<br />jQuery("#list").sortGrid(&#39;lastmodifieddisplay&#39;, true);&#160;</p>
<p>--- What is the matter here? Am I doing things correctly?<br />Thanks!<br />Thor.&#160;</p>
]]></description>
        	        	<pubDate>Wed, 04 Feb 2009 18:49:37 +0200</pubDate>
        </item>
</channel>
</rss>