<?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: Cannot get JQGrid working with JSON data</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/cannot-get-jqgrid-working-with-json-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/cannot-get-jqgrid-working-with-json-data/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>zippy on Cannot get JQGrid working with JSON data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/cannot-get-jqgrid-working-with-json-data#p26520</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/cannot-get-jqgrid-working-with-json-data#p26520</guid>
        	        	<description><![CDATA[<p>Oleg, thank you again. That was the problem and I had stared at it for so long without spotting that.</p>
]]></description>
        	        	<pubDate>Mon, 07 May 2012 05:20:31 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on Cannot get JQGrid working with JSON data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/cannot-get-jqgrid-working-with-json-data#p26518</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/cannot-get-jqgrid-working-with-json-data#p26518</guid>
        	        	<description><![CDATA[<p>I answered you <a href="http://stackoverflow.com/a/10474871/315935" target="_blank">here</a> before. You should use <strong>jsonReader</strong> instead of <strong>jsonreader</strong> to solve the problem.</p>
<p>Best regards<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Mon, 07 May 2012 02:45:16 +0300</pubDate>
        </item>
        <item>
        	<title>zippy on Cannot get JQGrid working with JSON data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/cannot-get-jqgrid-working-with-json-data#p26515</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/cannot-get-jqgrid-working-with-json-data#p26515</guid>
        	        	<description><![CDATA[<p>Hello. I am new to JQGrid and have been trying to get it working with some JSON data, but it&#39;s not going well. I wonder if anyone would be kind enough to help me out.</p>
<p>Here&#39;s my JSON data:</p>
<pre><p><input type='button' class='sfcodeselect' name='sfselectit1303' value='Select Code' data-codeid='sfcode1303' /></p><div class='sfcode' id='sfcode1303'>{
   &#34;total&#34;:&#34;1&#34;,
   &#34;page&#34;:&#34;1&#34;,
   &#34;userdata&#34;:{

   },
   &#34;records&#34;:&#34;2&#34;,
   &#34;rows&#34;:[
      {
         &#34;DateOfBirth&#34;:&#34;11/04/2012 12:00:00 AM&#34;,
         &#34;DisambiguationNote&#34;:&#34;Boring guy&#34;,
         &#34;FirstName&#34;:&#34;Joe&#34;,
         &#34;LastName&#34;:&#34;Bloggs&#34;,
         &#34;MiddleName&#34;:&#34;Binkie&#34;,
         &#34;PersonId&#34;:&#34;1&#34;
      },
      {
         &#34;DateOfBirth&#34;:&#34;01/01/2001 12:00:00 AM&#34;,
         &#34;DisambiguationNote&#34;:&#34;someone else&#34;,
         &#34;FirstName&#34;:&#34;Edna&#34;,
         &#34;LastName&#34;:&#34;Edwards&#34;,
         &#34;MiddleName&#34;:&#34;Edith&#34;,
         &#34;PersonId&#34;:&#34;8&#34;
      }
   ]
}
</div></pre>
<p>And here&#39;s my grid code:</p>
<pre><p><input type='button' class='sfcodeselect' name='sfselectit848' value='Select Code' data-codeid='sfcode848' /></p><div class='sfcode' id='sfcode848'>$(function () {
    $(&#34;#persongrid&#34;).jqGrid({
        url: &#39;/Person/List&#39;,
        datatype: &#39;json&#39;,
        mtype: &#39;GET&#39;,
        jsonreader: {
            root: &#34;rows&#34;,
            page: &#34;page&#34;,
            total: &#34;total&#34;,
            records: &#34;records&#34;,
            repeatitems: false,
            id: &#34;5&#34;  ,
            cell: &#34;&#34;  ,
            userdata: &#34;userdata&#34;
        },
        colModel: [
            { name: &#39;DateOfBirth&#39;, index: &#39;DateOfBirth&#39;,sorttype:&#39;date&#39; },
            { name: &#39;DisambiguationNote&#39;, index: &#39;DisambiguationNote&#39; },
            { name: &#39;FirstName&#39;, index: &#39;FirstName&#39; },
            { name: &#39;LastName&#39;, index: &#39;LastName&#39; },
            { name: &#39;MiddleName&#39;, index: &#39;MiddleName&#39; },
            { name: &#39;PersonId&#39;, index: &#39;PersonId&#39;,sorttype:&#39;int&#39; }
        ],
        pager: &#39;#persongridpager&#39;,
        rowNum: 10,
        rowList: [10, 20, 30],
        viewrecords: true,
        gridview: true,
        caption: &#39;People&#39;
    });
});</div></pre>
<p>What I get is a grid that has the column headings but no contents. It just displays "Loading&#8230;" forever.</p>
<p>After a bit of investigation I can see that it makes multiple calls to the getAccessor method and on the last call the first parameter to the method (obj) is undefined. That seems to be what&#39;s causing the grid to stop rendering, but why?</p>
<p>I can see that the JSON data is being retrieved as above from the AJAX request, and I have been through the JSON data instructions for JQGrid quite carefully but can&#39;t see what I&#39;m doing wrong. Can anyone help? Thank you.</p>
]]></description>
        	        	<pubDate>Sun, 06 May 2012 21:45:02 +0300</pubDate>
        </item>
</channel>
</rss>