<?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: jqGrid not loading w/ JSON</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-not-loading-w-json</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/jqgrid-not-loading-w-json/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>OlegK on jqGrid not loading w/ JSON</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-not-loading-w-json#p18847</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-not-loading-w-json#p18847</guid>
        	        	<description><![CDATA[<p>First of all you have declare &#39;account_number&#39; as a column name and you data has "account": "24811&#8243;. You should make the same name of the filed names.</p>
<p>To make the program working is to produce JSON data in a little format which corresponds the standard jsonReader (see <a rel="nofollow" href="/jqgridwiki/doku.php?id=wiki:retrieving_data#json_data" target="_blank"></a><a href="http://www.trirand.com/jqgridw" rel="nofollow" target="_blank">http://www.trirand.com/jqgridw</a>.....#json_data for details) where the data for every row has NO name prefix and position corresponds to the column position</p>
<p>{<br />&#160; "total": "11&#8243;,<br />&#160; "page": "1&#8243;,<br />&#160; "records": "258&#8243;,<br />&#160; "rows": [<br />&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160; "id": "1956",<br />&#160;&#160;&#160;&#160;&#160; "cell": <strong>[<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; "01-27-2010",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; "24811",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; "Leslie Haefeli",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; "4040 Pioneer Avenue Ste 206",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; "Las Vegas",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; "NV",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; "89102",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; "150.0",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; "This transaction has been approved"<br />&#160;&#160;&#160;&#160;&#160; ]</strong><br />&#160;&#160;&#160; }<br />&#160;&#160;&#160; &#8230;<br />&#160; ]<br />} </p>
<p>Another way is to add <strong>jsonReader : { repeatitems: false }</strong> parameter to the jqGrid and produce JSON data like following</p>
<p>{<br />&#160; "total": "11&#8243;,<br />&#160; "page": "1&#8243;,<br />&#160; "records": "258&#8243;,<br />&#160; "rows": <strong>[<br />&#160;&#160;&#160; {</strong><br />&#160;&#160;&#160;&#160; "id": "1956",<br />&#160;&#160;&#160;&#160; "city": "Las Vegas",<br />&#160;&#160;&#160;&#160; "address": "4040 Pioneer Avenue Ste 206 ",<br />&#160;&#160;&#160;&#160; "transaction_note": "This transaction has been approved"<br />&#160;&#160;&#160;&#160; "zip": "89102",<br />&#160;&#160;&#160;&#160; <strong>"account_number"</strong>: "24811",<br />&#160;&#160;&#160;&#160; "transaction_date": "01-27-2010",<br />&#160;&#160;&#160;&#160; "state": "NV",<br />&#160;&#160;&#160;&#160; "name": "Leslie Haefeli",<br />&#160;&#160;&#160;&#160; "charge_amount": "150.0"<br />&#160;&#160;&#160; <strong>}<br />&#160;&#160;&#160; ...<br />&#160; ]</strong><br />}</p>
<p>Best regards<br />Oleg</p>
]]></description>
        	        	<pubDate>Wed, 28 Jul 2010 23:36:42 +0300</pubDate>
        </item>
        <item>
        	<title>jkofoed on jqGrid not loading w/ JSON</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-not-loading-w-json#p18844</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-not-loading-w-json#p18844</guid>
        	        	<description><![CDATA[</p>
<p>UPDATE:&#160;</p>
<p>I had an issue with the JSON &#38;ndash; I misunderstood the format. &#160;Fixed that, now I get blank rows.</p>
<p><input type='button' class='sfcodeselect' name='sfselectit2742' value='Select Code' data-codeid='sfcode2742' /></p>
<div class='sfcode' id='sfcode2742'>
<p>$(&#39;#fee_payments_table&#39;).jqGrid({</p>
<p>&#160;&#160; &#160;url:&#39;&#60;%= url_for(:action =&#62; &#34;fee_payments_made_json&#34;, :start_date =&#62; @start_date, :end_date =&#62; @end_date) %&#62;&#39;,</p>
<p>&#160;&#160; &#160;datatype: &#34;json&#34;,</p>
<p>&#160;&#160; &#160;colNames:[&#39;Transaction Date&#39;, &#39;Account&#39;, &#39;Name&#39;, &#39;Address&#39;, &#39;City&#39;, &#39;State&#39;, &#39;Zip&#39;, &#39;Charge Amount&#39;, &#39;Transaction Note&#39;],</p>
<p>&#160;&#160; &#160;colModel:[</p>
<p style=&#34;&#34;&#34;&#34;&#34;padding-left:&#34;&#34;&#34;&#34;>{name:&#39;transaction_date&#39;,index:&#39;transaction_date&#39;, width:65},</p>
<p style=&#34;&#34;&#34;&#34;&#34;padding-left:&#34;&#34;&#34;&#34;>{name:&#39;account_number&#39;,index:&#39;account_number&#39;, width:50},</p>
<p style=&#34;&#34;&#34;&#34;&#34;padding-left:&#34;&#34;&#34;&#34;>{name:&#39;name&#39;,index:&#39;name&#39;, width:50},</p>
<p style=&#34;&#34;&#34;&#34;&#34;padding-left:&#34;&#34;&#34;&#34;>{name:&#39;address&#39;,index:&#39;street&#39;, width:110},</p>
<p style=&#34;&#34;&#34;&#34;&#34;padding-left:&#34;&#34;&#34;&#34;>{name:&#39;city&#39;,index:&#39;city&#39;, width:50},</p>
<p style=&#34;&#34;&#34;&#34;&#34;padding-left:&#34;&#34;&#34;&#34;>{name:&#39;state&#39;,index:&#39;state&#39;, width:40},</p>
<p style=&#34;&#34;&#34;&#34;&#34;padding-left:&#34;&#34;&#34;&#34;>{name:&#39;zip&#39;,index:&#39;zip&#39;, width:40},</p>
<p style=&#34;&#34;&#34;&#34;&#34;padding-left:&#34;&#34;&#34;&#34;>{name:&#39;charge_amount&#39;,index:&#39;charge_amount&#39;, width:40,align:&#34;right&#34;},</p>
<p style=&#34;&#34;&#34;&#34;&#34;padding-left:&#34;&#34;&#34;&#34;>{name:&#39;transaction_note&#39;,index:&#39;transaction_note&#39;, width:275, sortable:false}</p>
<p style=&#34;&#34;&#34;&#34;&#34;padding-left:&#34;&#34;&#34;&#34;>],</p>
<p style=&#34;&#34;&#34;&#34;&#34;padding-left:&#34;&#34;&#34;&#34;>rowNum:25,</p>
<p style=&#34;&#34;&#34;&#34;&#34;padding-left:&#34;&#34;&#34;&#34;>rowList:[10,25,50,100],</p>
<p style=&#34;&#34;&#34;&#34;&#34;padding-left:&#34;&#34;&#34;&#34;>pager: &#39;#pager&#39;,</p>
<p style=&#34;&#34;&#34;&#34;&#34;padding-left:&#34;&#34;&#34;&#34;>sortname: &#39;transaction_date&#39;,</p>
<p style=&#34;&#34;&#34;&#34;&#34;padding-left:&#34;&#34;&#34;&#34;>viewrecords: true,</p>
<p style=&#34;&#34;&#34;&#34;&#34;padding-left:&#34;&#34;&#34;&#34;>sortorder: &#34;desc&#34;,</p>
<p style=&#34;&#34;&#34;&#34;&#34;padding-left:&#34;&#34;&#34;&#34;>caption:&#34;Fee Payments&#34;</p>
<p>});</p>
</div>
<p>And the JSON object:&#160;</p>
<pre><span style="font-family: monospace;"><pre><span style="font-family: monospace;"><pre><div class="&#34;sfcode&#34;"><div class="&#34;sfcode&#34;"><span style="font-family: monospace;"><span style="font-family: Tahoma, Helvetica, Arial, Verdana, sans-serif;"><p>{</p><p>"total": "11",</p><p>"page": "1",</p><p>"records": "258",</p><p>"rows": [{"id": "1956",</p><p>"cell": {"city": "Las Vegas",</p><p>"address": "4040 Pioneer Avenue Ste 206 ",</p><p>"transaction_note": "This transaction has been approved"</p><p>"zip": "89102",</p><p>"account": "24811",</p><p>"transaction_date": "01-27-2010",</p><p>"state": "NV",</p><p>"name": "Leslie Haefeli",</p><p>"charge_amount": "150.0"</p><p>}</p><p>...</p><p>}]</p><p>}&#160;</p></span></span></div></div></pre>
</p>
<p></span><br />
</span></p>
]]></description>
        	        	<pubDate>Wed, 28 Jul 2010 22:45:19 +0300</pubDate>
        </item>
        <item>
        	<title>jkofoed on jqGrid not loading w/ JSON</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-not-loading-w-json#p18784</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-not-loading-w-json#p18784</guid>
        	        	<description><![CDATA[<p>The page loads, the jqGrid loads and flashes on the screen then all I get is the loading... dialog. &#160;I am also getting a js error:&#160;</p>
<p>u is undefined:</p>
<p><a class="errorSource a11yFocus " target="_blank">false?s.id:a.p.keyIndex;if(B.length&#62;0&#38;...=  "ui-widget-content jqgrow ui-row-&#39;+ &#160;line 56 of jquery-jqGrid.js&#160;</a></p>
</p>
<p>Here is the jqGrid init call:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1812' value='Select Code' data-codeid='sfcode1812' /></p>
<div class='sfcode' id='sfcode1812'>
<p>$(&#39;#fee_payments_table&#39;).jqGrid({</p>
<p>url:&#39;/staffonly/employee_features/fee_payments_made_json?end_date=2010-07-24&#38;amp;start_date=2010-07-22&#39;,</p>
<p>datatype: &#34;json&#34;,</p>
<p>colNames:[&#39;Date&#39;, &#39;Account&#39;, &#39;Name&#39;, &#39;Address&#39;, &#39;City&#39;, &#39;State&#39;, &#39;Zip&#39;, &#39;Charge Amount&#39;, &#39;Transaction Note&#39;],</p>
<p>colModel:[</p>
<p>{name:&#39;transaction_date&#39;,index:&#39;transaction_date&#39;, width:65},</p>
<p>{name:&#39;account&#39;,index:&#39;account&#39;, width:50},</p>
<p>{name:&#39;name&#39;,index:&#39;name&#39;, width:50},</p>
<p>{name:&#39;address&#39;,index:&#39;street&#39;, width:110},</p>
<p>{name:&#39;city&#39;,index:&#39;city&#39;, width:50},</p>
<p>{name:&#39;state&#39;,index:&#39;state&#39;, width:30},</p>
<p>{name:&#39;zip&#39;,index:&#39;zip&#39;, width:40},</p>
<p>{name:&#39;charge_amount&#39;,index:&#39;charge_amount&#39;, width:40,align:&#34;right&#34;},</p>
<p>{name:&#39;transaction_note&#39;,index:&#39;transaction_note&#39;, width:275, sortable:false}</p>
<p>],</p>
<p>rowNum:25,</p>
<p>rowList:[10,25,50,100],</p>
<p>pager: &#39;#pager&#39;,</p>
<p>sortname: &#39;transaction_date&#39;,</p>
<p>viewrecords: true,</p>
<p>sortorder: &#34;desc&#34;,</p>
<p>caption:&#34;Fee Payments&#34;</p>
<p>});</p>
</div>
<p>Here is the JSON (partial) object:&#160;</p>
<p>
{ </p>
<ul class="obj collapsible">
<li>total: "2"</li>
<li>page: "1"</li>
<li>records: "68"-</li>
</ul>
<p>rows: [ </p>
<ul>
<li>
<div class="collapser">{</div>
<ul class="obj collapsible">
<li>city: "Buffalo Grove"</li>
<li>address: "350 McHenry Road "</li>
<li>zip: "60089"</li>
<li>account: "31925"</li>
<li>charge_amount: 99</li>
<li>state: "IL"</li>
<li>name: "Bill Feldgreber"</li>
<li>transaction_note: "This  transaction has been approved"</li>
<li>transaction_date:  "01-22-2010"</li>
</ul>
<p>}</p>
</li>
<li>
<div class="collapser">{</div>
<ul class="obj collapsible">
<li>city: "Ontario"</li>
<li>address: "7689 Chapman Dr "</li>
<li>zip: "14519"</li>
<li>account: "05824"</li>
<li>charge_amount: 410.88</li>
<li>state: "NY"</li>
<li>name: "Joseph Crestuk"</li>
<li>transaction_note: "This  transaction has been approved"</li>
<li>transaction_date:  "01-22-2010"</li>
</ul>
<p>}</p>
</li>
<li>{
<ul>
<li>city: "Wichita"</li>
</ul>
</li>
</ul>
<li>
<ul>
<li>&#160;
<ul>
<li>address:  "1405 S Hydraulic "</li>
<li>zip: "67211"</li>
<li>account: "37079"</li>
<li>charge_amount: 160.2</li>
<li>state: "KS"</li>
<li>name: "Mike Snowbarger"</li>
<li>transaction_note: "This  transaction has been approved"</li>
<li>transaction_date:  "01-30-2010"</li>
</ul>
</li>
<li>}</li>
</ul>
</li>
<li>]</li>
<p>}</p>
<ul class="obj collapsible">
</ul>
]]></description>
        	        	<pubDate>Fri, 23 Jul 2010 20:07:15 +0300</pubDate>
        </item>
</channel>
</rss>