<?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: handle json data with root element</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/handle-json-data-with-root-element</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/handle-json-data-with-root-element/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on handle json data with root element</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/handle-json-data-with-root-element#p13050</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/handle-json-data-with-root-element#p13050</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>As you can see - in case of custom datatype you should add your code from loadComplete after addJSONData, or use gridComplete event which is lunched when all data is in the grid.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Tue, 15 Dec 2009 19:23:02 +0200</pubDate>
        </item>
        <item>
        	<title>Rushi on handle json data with root element</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/handle-json-data-with-root-element#p13015</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/handle-json-data-with-root-element#p13015</guid>
        	        	<description><![CDATA[<p>Tony,</p>
<p>Another thing: I used the above approach and it seems work fine (although I am waiting to get an answer from you for the "Search Big Sets"). The problem I am facing is I have a loadComplete function tied to the grid and if I use your above suggested approach, my loadComplete function doesn&#39;t get called. Am I missing something?</p></p>
]]></description>
        	        	<pubDate>Tue, 15 Dec 2009 02:32:38 +0200</pubDate>
        </item>
        <item>
        	<title>Rushi on handle json data with root element</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/handle-json-data-with-root-element#p13014</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/handle-json-data-with-root-element#p13014</guid>
        	        	<description><![CDATA[<p>Thanks a lot, Tony. I&#39;ll try it out right away. Another question though, will this approach work in case of the "Search Big Sets" example that you have in the demo? I need to display list of records from a database table in the grid but the database table contains over 80,000 records. I was wondering if this approach with the custom datatype function combined with the "Search Big Sets" logic work for such a kind of load. Appreciate your response.</p>
<p>Thanks,</p>
<p>Rushi</p>
]]></description>
        	        	<pubDate>Tue, 15 Dec 2009 02:00:20 +0200</pubDate>
        </item>
        <item>
        	<title>tony on handle json data with root element</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/handle-json-data-with-root-element#p12968</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/handle-json-data-with-root-element#p12968</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>I suggest you in this case to use datatype as function. The code can look like this</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8161' value='Select Code' data-codeid='sfcode8161' /></p>
<div class='sfcode' id='sfcode8161'>
<p>jQuery("#listdt").jqGrid({&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160; datatype : &#160;&#160;&#160; function&#160; (pdata) {<br />&#160;&#160;&#160; &#160;&#160;&#160; $.ajax({<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; url:&#39;server.php?q=2&#39;,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; data:pdata,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; dataType:"json",<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; complete: function(jsondata,stat){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; if(stat=="success") {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var thegrid = jQuery("#listdt")[0];</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var resp =&#160; $.jgrid.parse(jsondata.responseText);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; thegrid.addJSONData(resp.ListData)<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160; &#160;&#160;&#160; });<br />&#160;&#160;&#160; },</p>
<p>...</p>
<p>})</p>
</div>
<p>Instead I will think how this &#39;d&#39; property in parse function to be configurable.</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sun, 13 Dec 2009 18:03:51 +0200</pubDate>
        </item>
        <item>
        	<title>Rushi on handle json data with root element</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/handle-json-data-with-root-element#p12945</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/handle-json-data-with-root-element#p12945</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>I have a similar problem to the above however, the instead of "d", the name coming back from my web service is "ListData". Also, this will change depending on the type of the request. I cannot change the returned string from the web service so I need to handle this somehow on the javascript side.</p>
<p>{"ListData" : {"Success":"true","Record":"1", "rows":[{"MyID" : "7","MyTitle" : "MyTitle","StartDate" : "09.12.2009","EndDate" : "31.12.2009"}]}}</p>
<p>How do I specify the jsonReader so the grid can read the data contained in the rows array? I tried the following with no success:</p>
<p>rows: &#39;ListData&#39;<br />rows: &#39;ListData.rows&#39;</p>
<p>If I populate the grid using addRowData, it works fine but I want to have it autopopulated using the json datatype. I know I am missing something very basic. </p>
<p>Can anyone help me?</p>
<p>Thanks,<br />Rushi</p>
]]></description>
        	        	<pubDate>Sat, 12 Dec 2009 09:10:29 +0200</pubDate>
        </item>
        <item>
        	<title>tony on handle json data with root element</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/handle-json-data-with-root-element#p12925</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/handle-json-data-with-root-element#p12925</guid>
        	        	<description><![CDATA[<p>Hello</p>
<p>if your output is like this</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3421' value='Select Code' data-codeid='sfcode3421' /></p>
<div class='sfcode' id='sfcode3421'>
<p>{&#8221;d&#8221;:{&#8221;currPage&#8221;:1,&#8221;totalPages&#8221;:1,&#8221;totalRecords&#8221;:2,&#8221;users&#8221;:[{"id":1, name":"x1", email:"e1"},{"id":2,email:"e2"}]}}</p>
</div>
<p>you should not do anything.</p>
<p>I.e not data, but d. jqGrid support the d property generated from some Microsoft products.</p>
<p>Another possible solution is to use a datatype as function , where you can put what you want to the json parser.</p>
<p>See demos.</p>
<p>Best regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Fri, 11 Dec 2009 14:29:59 +0200</pubDate>
        </item>
        <item>
        	<title>gsproof on handle json data with root element</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/handle-json-data-with-root-element#p12892</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/handle-json-data-with-root-element#p12892</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>I have a server that returns JSON data for jqgrid in the format with root element, like:</p>
<p>{&#8221;data&#8221;:{&#8221;currPage&#8221;:1,&#8221;totalPages&#8221;:1,&#8221;totalRecords&#8221;:2,&#8221;users&#8221;:[{"id":1, name":"x1", email:"e1"},{"id":2,email:"e2"}]}}</p>
</p>
<p>I was trying to use the dot notation for root, page, etc, but with no luck.</p>
<p>jsonReader: {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; root: &#8220;data.users&#8221;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; page: &#8220;data.currPage&#8221;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; total: &#8220;data.totalPages&#8221;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; records: &#8220;data.totalRecords&#8221;,<br />&#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; id: &#8220;0&#8243;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
<p>Is that supported?</p>
<p>If not what would be the best path to take?</p>
</p>
<p>Thanks.</p>
]]></description>
        	        	<pubDate>Thu, 10 Dec 2009 16:35:49 +0200</pubDate>
        </item>
</channel>
</rss>