<?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 and JSON returns no data</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-json-returns-no-data</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-and-json-returns-no-data/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>OlegK on jqGrid and JSON returns no data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-json-returns-no-data#p19622</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-json-returns-no-data#p19622</guid>
        	        	<description><![CDATA[<p>There are different ways to implement what you want. For example you can place table and pager inside a div:</p>
<p>&#60;div id="gridResults"&#62;<br /><span style="font-size: 14.1667px;">&#160;&#160; &#160;&#60;table id="grid"&#62;&#60;/table&#62;<br /><span style="font-size: 14.1667px;">&#160;&#160; &#160;&#60;div id="pager"&#62;&#60;/div&#62;<br /><span style="font-size: 14.1667px;">&#60;/div&#62;</span></span></span></p>
<p>then bind every button to a function which create the&#160;unique&#160;grid which you need in the corresponding case</p>
<p>var resetGrid = function() {<br /><span style="font-size: 14.1667px;">&#160;&#160; &#160;$("gridResults").empty().html("&#60;table id="grid"&#62;&#60;/table&#62;&#60;div id="pager"&#62;&#60;/div&#62;");<br /><span style="font-size: 14.1667px;">}<br /><span style="font-size: 14.1667px;">$("#btnCustomers").click(function(){<br /><span style="font-size: 14.1667px;">&#160;&#160; &#160;resetGrid();<br /><span style="font-size: 14.1667px;">&#160;&#160; &#160;var grid = $("#grid");<br /><span style="font-size: 14.1667px;">&#160;&#160; &#160;grid.jqGrid({<br /><span style="font-size: 14.1667px;">&#160;&#160; &#160; &#160; &#160;url: myCustomersUrl,<br /><span style="font-size: 14.1667px;">&#160;&#160; &#160; &#160; &#160;colModel: {<br /><span style="font-size: 14.1667px;">&#160;&#160; &#160; &#160; &#160; &#160; &#160; // information about customer table<br /><span style="font-size: 14.1667px;">&#160;&#160; &#160; &#160; &#160;},<br /><span style="font-size: 14.1667px;">&#160;&#160; &#160; &#160; &#160;// &#8230;<br /><span style="font-size: 14.1667px;">&#160;&#160; &#160;});<br /><span style="font-size: 14.1667px;">}</span></span></span></span></span></span></span></span></span></span></span></span></span></p>
<p>It should work.</p>
]]></description>
        	        	<pubDate>Thu, 09 Sep 2010 03:22:31 +0300</pubDate>
        </item>
        <item>
        	<title>mikeerickson on jqGrid and JSON returns no data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-json-returns-no-data#p19621</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-json-returns-no-data#p19621</guid>
        	        	<description><![CDATA[<p>I have one grid div &#160; &#60;table id="masterTable"&#62; &#160;and 5 separate buttons</p>
</p>
<p>&#60;button id="btnCustomers"&#62;Customers&#60;/button&#62;</p>
<p>&#60;button id="btnInvoices"&#62;Invoices&#60;/button&#62;</p>
<p>&#60;button id="btnInventory"&#62;Inventory&#60;/button&#62;</p>
<p>&#60;button id="btnRMA"&#62;RMA&#60;/button&#62;</p>
<p>&#60;button id="btnSales"&#62;Sales&#60;/button&#62;</p>
</p>
<p>When a button is clicked, it should build/update a grid with appropriate information (all different tables, different columns etc)</p>
<p>I know I could create 5 separate divs, etc. but that seems like the wrong approach (I am thinking I would just rebuild the table object based on what is selected)</p>
<p>mike</p>
]]></description>
        	        	<pubDate>Thu, 09 Sep 2010 02:51:37 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on jqGrid and JSON returns no data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-json-returns-no-data#p19619</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-json-returns-no-data#p19619</guid>
        	        	<description><![CDATA[<p>Hi MSE!</p>
<p>Sorry, but I don&#39;t understand what do you mean under "5 buttons that will access 5 different sections of data". Could you explain this more detailed in other words.</p>
<p>Regards<br /><span style="font-size: 14.1667px;">Oleg</span></p>
]]></description>
        	        	<pubDate>Thu, 09 Sep 2010 02:47:37 +0300</pubDate>
        </item>
        <item>
        	<title>mikeerickson on jqGrid and JSON returns no data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-json-returns-no-data#p19617</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-json-returns-no-data#p19617</guid>
        	        	<description><![CDATA[<blockquote>
<p>OlegK said:</p>
<p>Hi!</p>
<p>In general you data and jqGrid seems almost OK. After replacing some <strong>&#8243;</strong>&#160;characters to <strong>"</strong> (probably a problem with pasting of data in the forum) I could see the data loaded. The only error in JSON data was <strong>"records": "2"</strong> and <strong>6</strong> data items. Because you sorttype parameters in the column definition you probably wanted to use local sorting. To do this you should include <strong>loadonce: true</strong>&#160;to the list of jqGrid parameters.</p>
<p>You can see your jqGrid live on <a rel="nofollow" href="http://www.ok-soft-gmbh.com/jqGrid/mikeerickson.htm" target="_blank"></a><a href="http://www.ok-soft-gmbh.com/jq" rel="nofollow" target="_blank">http://www.ok-soft-gmbh.com/jq</a>.....ickson.htm. I made the only additional change <strong>rowNum: 5</strong> to be able that local paging work and sorting works also through all data and not through the data on the current page.</p>
<p>Best regards</p>
<p>Oleg</p>
</blockquote>
<hr />
<p>Awesome, all is working now! &#160;Thank you so much! &#160; &#160;So, my last questions &#160;and I can move forward with development...</p>
</p>
<p>Assuming I have one generic table and 5 buttons that will access 5 different sections of data, how can I rebuild grid at runtime (or will I need to have 5 separate DIVs and hide/show accordingly.</p>
</p>
<p>Do I just recall the same setup code (is there a need to destroy the current grid before rebuilding)</p>
</p>
<p>mse</p>
]]></description>
        	        	<pubDate>Thu, 09 Sep 2010 01:50:36 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on jqGrid and JSON returns no data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-json-returns-no-data#p19614</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-json-returns-no-data#p19614</guid>
        	        	<description><![CDATA[<p>Hi!</p>
<p>In general you data and jqGrid seems almost OK. After replacing some <strong>&#8243;</strong>&#160;characters to <strong>"</strong> (probably a problem with pasting of data in the forum) I could see the data loaded. The only error in JSON data was <strong>"records": "2"</strong> and <strong>6</strong> data items. Because you sorttype parameters in the column definition you probably wanted to use local sorting. To do this you should include <strong>loadonce: true</strong>&#160;to the list of jqGrid parameters.</p>
<p>You can see your jqGrid live on <a href="http://www.ok-soft-gmbh.com/jqGrid/mikeerickson.htm" rel="nofollow" target="_blank"><a href="http://www.ok-soft-gmbh.com/jq" rel="nofollow">http://www.ok-soft-gmbh.com/jq</a>.....ickson.htm</a>. I made the only additional change <strong>rowNum: 5</strong> to be able that local paging work and sorting works also through all data and not through the data on the current page.</p>
<p>Best regards</p>
<p>Oleg</p>
]]></description>
        	        	<pubDate>Thu, 09 Sep 2010 00:52:37 +0300</pubDate>
        </item>
        <item>
        	<title>mikeerickson on jqGrid and JSON returns no data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-json-returns-no-data#p19607</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-json-returns-no-data#p19607</guid>
        	        	<description><![CDATA[<p>I have following jqGrid setup (and asscociated sample json file) &#160; When I view the page the grid is drawn with no data?</p>
</p>
<p>$("#masterList").jqGrid({</p>
<p>url:			"sample.json",</p>
<p>datatype:		"json",</p>
<p>colNames:		[&#39;Inv No&#39;,&#39;Date&#39;, &#39;Client&#39;, &#39;Amount&#39;,&#39;Tax&#39;,&#39;Total&#39;,&#39;Notes&#39;],</p>
<p>colModel:[</p>
<p>{name:&#39;id&#39;,index:&#39;id&#39;, width:55, editable:true, sorttype:&#39;int&#39;},</p>
<p>{name:&#39;invdate&#39;,index:&#39;invdate&#39;, width:90, sorttype:&#39;date&#39;, formatter:&#39;date&#39;, datefmt:&#39;d/m/Y&#39;},</p>
<p>{name:&#39;name&#39;,index:&#39;name&#39;, width:100},</p>
<p>{name:&#39;amount&#39;,index:&#39;amount&#39;, width:80, align:"right", sorttype:&#39;number&#39;,formatter:&#39;number&#39;},</p>
<p>{name:&#39;tax&#39;,index:&#39;tax&#39;, width:80, align:"right",sorttype:&#39;number&#39;,formatter:&#39;number&#39;},</p>
<p>{name:&#39;total&#39;,index:&#39;total&#39;, width:80,align:"right",sorttype:&#39;number&#39;,formatter:&#39;number&#39;},</p>
<p>{name:&#39;note&#39;,index:&#39;note&#39;, width:150, sortable:false,editable:true}</p>
<p>],</p>
<p>rowNum:			10,</p>
<p>rowList:		[10,20,30],</p>
<p>height: 		&#39;auto&#39;,</p>
<p>pager: 			&#39;#masterPager&#39;,</p>
<p>sortname: 		&#39;invdate&#39;,</p>
<p>viewrecords:	true,</p>
<p>sortorder:		"desc",</p>
<p>});</p>
<p>sample.json looks like this</p>
</p>
<p>{</p>
<p>"total": "1",</p>
<p>"page": "1",</p>
<p>"records": "2",</p>
<p>"rows": [</p>
<p>{</p>
<p>"id": "1",</p>
<p>"cell": [</p>
<p>"1",</p>
<p>"2010-10-01",</p>
<p>"name1",</p>
<p>"300",</p>
<p>"10",</p>
<p>"310",</p>
<p>"note"</p>
<p>]</p>
<p>},</p>
<p>{</p>
<p>"id": "2",</p>
<p>"cell": [</p>
<p>"2",</p>
<p>"2010-10-02",</p>
<p>"name2",</p>
<p>"300",</p>
<p>"10",</p>
<p>"310",</p>
<p>"note"</p>
<p>]</p>
<p>},</p>
<p>{</p>
<p>"id": "3",</p>
<p>"cell": [</p>
<p>"3",</p>
<p>"2010-10-03",</p>
<p>"name3",</p>
<p>"300",</p>
<p>"10",</p>
<p>"310",</p>
<p>"note"</p>
<p>]</p>
<p>},</p>
<p>{</p>
<p>"id": "4",</p>
<p>"cell": [</p>
<p>"4",</p>
<p>"2010-10-04",</p>
<p>"name4",</p>
<p>"300",</p>
<p>"10",</p>
<p>"310",</p>
<p>"note"</p>
<p>]</p>
<p>},</p>
<p>{</p>
<p>"id": "5",</p>
<p>"cell": [</p>
<p>"5",</p>
<p>"2010-10-05",</p>
<p>"name5",</p>
<p>"300",</p>
<p>"10",</p>
<p>"310",</p>
<p>"note"</p>
<p>]</p>
<p>},</p>
<p>{</p>
<p>"id": "6",</p>
<p>"cell": [</p>
<p>"6",</p>
<p>"2010-10-06",</p>
<p>"name6",</p>
<p>"300",</p>
<p>"10",</p>
<p>"310",</p>
<p>"note"</p>
<p>]</p>
<p>}</p>
<p>]</p>
<p>}</p>
]]></description>
        	        	<pubDate>Wed, 08 Sep 2010 19:24:35 +0300</pubDate>
        </item>
</channel>
</rss>