<?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: No data is displaying in my grid...</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/no-data-is-displaying-in-my-grid</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/no-data-is-displaying-in-my-grid/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>simspace on No data is displaying in my grid...</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/no-data-is-displaying-in-my-grid#p19487</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/no-data-is-displaying-in-my-grid#p19487</guid>
        	        	<description><![CDATA[<p>Excellent! Thanks for your help Oleg.</p>
]]></description>
        	        	<pubDate>Thu, 02 Sep 2010 17:17:28 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on No data is displaying in my grid...</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/no-data-is-displaying-in-my-grid#p19476</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/no-data-is-displaying-in-my-grid#p19476</guid>
        	        	<description><![CDATA[<p>Hi!</p>
<p>1) In some functions obj parameter are the data from the json response, in other (id and cell) is only a row of data.</p>
<p>2) Every row <span style="text-decoration: underline;">must</span> have an unique id. So you have to have ids. If there are no ids in your data you should just define ids with respect of one more function. You define a variable</p>
<p>var curId = 0;</p>
<p>and then use in inside the jsonReader:</p>
<p>jsonReader : {</p>
<p>&#160;&#160; &#160;root: function (obj) { return obj.DATA; },</p>
<p>&#160;&#160; &#160;cell: function (obj) { return obj; },</p>
<p>&#160;&#160; &#160;id: function (obj) { curId++; return curId; },</p>
<p>&#160;&#160; &#160;page: function (obj) { return 1; },</p>
<p>&#160;&#160; &#160;total: function (obj) { return 1; },</p>
<p>&#160;&#160; &#160;records: function (obj) { return obj.DATA.length; }</p>
<p>}</p>
<p>Look at <a href="http://www.ok-soft-gmbh.com/jqGrid/simspace1.htm" rel="nofollow" target="_blank"><a href="http://www.ok-soft-gmbh.com/jq" rel="nofollow">http://www.ok-soft-gmbh.com/jq</a>.....space1.htm</a>.</p>
<p>Regards</p>
<p>Oleg</p>
]]></description>
        	        	<pubDate>Thu, 02 Sep 2010 02:04:33 +0300</pubDate>
        </item>
        <item>
        	<title>simspace on No data is displaying in my grid...</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/no-data-is-displaying-in-my-grid#p19474</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/no-data-is-displaying-in-my-grid#p19474</guid>
        	        	<description><![CDATA[<p>Hi Oleg,</p>
<p>That is awesome. Works great Thank you!</p>
<p>I do have two more questions about your change...</p>
<ol>
<li>I&#39;m trying to understand the code in jsonReader. It looks like you&#39;re creating 5 function that receive an "object" parameter.&#160;What does the "object" parameter&#160;represent? Where is that coming from? Is that the json response?</li>
<li>If I take the "id" column out of the query and the grid as shown below, jQuery crashes. Do you know why?</li>
</ol>
<p>Thanks!</p>
<p>Chris</p>
<p><strong>* The Query</strong><br />SELECT name, email, phone, comment FROM test_table ORDER by id</p>
<p><strong>* The JSON</strong><br />{ "COLUMNS":["NAME","EMAIL","PHONE","COMMENT"],&#160;<br />&#160;&#160; "DATA":[ ["Rick Tester","rick@tester.org","555-666-7777","Test comments."],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ["Max Headroom","max@headroom.org","555-666-7777","Test comments."],<br />&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;["Jessica Levalore","jlevalore@Levalore.com","555-666-7777","Test comments."] ]}&#160;</p>
<p><strong>* The jqGrid Cols</strong><br />...<br />colNames:[&#39;name&#39;,&#39;email&#39;,&#39;phone&#39;,&#39;comment&#39;], <br />colModel :[&#160;{name:&#39;name&#39;, index:&#39;name&#39;, width:55}, <br />&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160;{name:&#39;email&#39;, index:&#39;email&#39;, width:55},<br />&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160;{name:&#39;phone&#39;, index:&#39;phone&#39;, width:15, align:&#39;center&#39;}, <br />&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160;{name:&#39;comment&#39;, index:&#39;comment&#39;, width:150, sortable:false} ],<br />....&#160;</p>
<ol> </ol></p>
]]></description>
        	        	<pubDate>Thu, 02 Sep 2010 01:31:50 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on No data is displaying in my grid...</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/no-data-is-displaying-in-my-grid#p19472</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/no-data-is-displaying-in-my-grid#p19472</guid>
        	        	<description><![CDATA[<p>Hello Chris!</p>
<p>Usage of jsonReader is the correct way if you have data in the form like you have, but first of all you should fix the data to make it correct JSON string. The string 555-666-7777 in the last row must be like in all other be quoted like following:</p>
<p>{ "COLUMNS":["ID","NAME","EMAIL","PHONE","COMMENT"], <br />&#160;&#160; "DATA":[ [1,"Rick Tester","rick@tester.org","555-666-7777","Test comments."],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; [5,"Max Headroom","max@headroom.org","555-666-7777","Test comments."],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; [13,"Jessica Levalore","jlevalore@Levalore.com","555-666-7777","Test comments."] ]}</p>
<p>A good place where you can verify your JSON data is <a href="http://www.jsonlint.com/" rel="nofollow" target="_blank">http://www.jsonlint.com/</a>.</p>
<p>Best regards<br />Oleg</p></p>
]]></description>
        	        	<pubDate>Wed, 01 Sep 2010 23:47:55 +0300</pubDate>
        </item>
        <item>
        	<title>simspace on No data is displaying in my grid...</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/no-data-is-displaying-in-my-grid#p19468</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/no-data-is-displaying-in-my-grid#p19468</guid>
        	        	<description><![CDATA[<p>Hi,&#160;I&#39;m new to jqGrid and I&#39;m having problems getting JSON&#160;data to display in the grid.&#160;I suspect it has to do with the data format the grid is expecting based on what I&#39;ve&#160;<a href="/jqgridwiki/doku.php?id=wiki:retrieving_data#json_data" target="_blank">read about regarding the jsonReader</a>&#160;and the default data format.</p>
<p>I know the JSON data is being returned to the client. I checked the response header.</p>
<p>Would someone please help figure out what am I missing?&#160;How can I display the data below&#160;in the grid?&#160;</p>
<p>Do I have to massage the JSON results to the expected default format? Or can I customize the format to fit the data returned?</p>
<p>Thank You!</p>
<p>Chris&#160;</p>
</p>
<p><strong><span style="text-decoration: underline;">My server-side sql query looks like this</span></strong><span style="text-decoration: underline;">:</span></p>
<p style="padding-left: 30px; ">SELECT id, name, email, phone, comment FROM test_table ORDER by id</p>
</p>
<p><strong><span style="text-decoration: underline;">The returned JSON data looks like this:</span></strong></p>
<p>{&#160;"COLUMNS":["ID","NAME","EMAIL","PHONE","COMMENT"],&#160;</p>
<p>&#160;&#160; "DATA":[ [1,"Rick Tester","rick@tester.org","555-666-7777","Test comments."],</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;[5,"Max Headroom","max@headroom.org","555-666-7777","Test comments."],</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; [13,"Jessica Levalore","jlevalore@Levalore.com",555-666-7777,"Test comments."] ]} &#160;</p>
</p>
<p><strong><span style="text-decoration: underline;">Here&#39;s my jqGrid code:</span></strong></p>
<p>jQuery("#leadlist").jqGrid({</p>
<p style="padding-left: 30px;">url:&#39;/hub/get-leads&#39;,</p>
<p style="padding-left: 30px;">datatype: &#39;json&#39;,</p>
<p style="padding-left: 30px;">mtype: &#39;GET&#39;,</p>
<p style="padding-left: 30px;">colNames:[&#39;id&#39;, &#39;name&#39;,&#39;email&#39;,&#39;phone&#39;,&#39;comment&#39;],</p>
<p style="padding-left: 30px;">colModel :[</p>
<p style="padding-left: 60px;">{name:&#39;id&#39;, index:&#39;id&#39;, formatter:&#39;integer&#39;, width:55},</p>
<p style="padding-left: 60px;">{name:&#39;name&#39;, index:&#39;name&#39;, width:55},</p>
<p style="padding-left: 60px;">{name:&#39;email&#39;, index:&#39;email&#39;, width:55},</p>
<p style="padding-left: 60px;">{name:&#39;phone&#39;, index:&#39;phone&#39;, width:15, align:&#39;center&#39;},</p>
<p style="padding-left: 60px;">{name:&#39;comment&#39;, index:&#39;comment&#39;, width:150, sortable:false}</p>
<p style="padding-left: 60px;">],</p>
<p style="padding-left: 30px;">jsonReader : { root: "DATA" },</p>
<p style="padding-left: 30px;">autoWidth:true,</p>
<p style="padding-left: 30px;">altRows:true,</p>
<p style="padding-left: 30px;">pager: &#39;#leadpager&#39;,</p>
<p style="padding-left: 30px;">rowNum:15,</p>
<p style="padding-left: 30px;">rowList:[15,30,45],</p>
<p style="padding-left: 30px;">sortname: &#39;name&#39;,</p>
<p style="padding-left: 30px;">sortorder: &#39;desc&#39;,</p>
<p style="padding-left: 30px;">viewrecords: true,</p>
<p style="padding-left: 30px;">caption: &#39;Leads&#39;</p>
<p>});</p>
]]></description>
        	        	<pubDate>Wed, 01 Sep 2010 20:00:47 +0300</pubDate>
        </item>
</channel>
</rss>