<?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: fail to load JQGrid with nested json</title>
	<link>http://www.trirand.com/blog/?page_id=393/discussion/fail-to-load-jqgrid-with-nested-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/discussion/fail-to-load-jqgrid-with-nested-json/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on fail to load JQGrid with nested json</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/fail-to-load-jqgrid-with-nested-json#p30491</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/fail-to-load-jqgrid-with-nested-json#p30491</guid>
        	        	<description><![CDATA[<p>Hello,</p>
</p>
<p>You will need to configure jsonmap in colModel. See docsumentation and online demo. we have such examples.</p>
</p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Mon, 14 Apr 2014 15:02:29 +0300</pubDate>
        </item>
        <item>
        	<title>kartik jajal on fail to load JQGrid with nested json</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/fail-to-load-jqgrid-with-nested-json#p30486</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/fail-to-load-jqgrid-with-nested-json#p30486</guid>
        	        	<description><![CDATA[<p>I have following JSON object format.</p>
</p>
<p>{"success":true,"message":[null],"page":0,"total":0,"records":0,"rows":[ {"userid":8,"username":"XYZ","userdetails":{"detailid":84,"city":"SDFE","state":"OPUY"}}, {"userid":9,"username":"ABCD","userdetails":{"detailid":85,"city":"QWSDF","state":"PLKJH"}} }</p>
</p>
<p>I want to display Username,City,State from the JSON data. It only shows the usename field, other fields are not able to display as userdetails is nested JSON object.</p>
<p>My JQgrid Model is as follows.</p>
</p>
<pre class="lang-php prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit163' value='Select Code' data-codeid='sfcode163' /></p><div class='sfcode' id='sfcode163'>  jq("#grid").jqGrid({
      url:&#39;${pageContext.servletContext.contextPath}/grid/load.action&#39;,
   datatype: &#39;json&#39;,
   mtype: &#39;GET&#39;,
      colNames:[&#39;Id&#39;, &#39;User Name&#39;, &#39;City&#39;,&#39;State&#39;],
      colModel:[
       {name:&#39;userid&#39;,index:&#39;userid&#39;, width:55,editable:true,editoptions:{readonly:false,size:10},hidden:true},
       {name:&#39;username&#39;,index:&#39;username&#39;, width:100,editable:true,edittype:&#39;text&#39;,
           editoptions: {
                dataInit: function (elem) {
                    myAutocomplete(elem, "${pageContext.servletContext.contextPath}/grid/autocomplete.action");

                }

       }},
       {name:&#39;city&#39;,index:&#39;city&#39;, width:100,editable:true, editrules:{required:true}, editoptions:{size:10}},
           {name:&#39;state&#39;,index:&#39;state&#39;, width:100,editable:true, editrules:{required:true}, editoptions:{size:10}}
      ],
      postData: {
   },
   rowNum:20,
      rowList:[20,40,60],
      height: 200,
      autowidth: true,
   rownumbers: true,
      pager: &#39;#pager&#39;,
      sortname: &#39;id&#39;,
      viewrecords: true,
      sortorder: "asc",
      caption:"Users",
      emptyrecords: "Empty records",
      loadonce: false,
      editurl:&#39;${pageContext.servletContext.contextPath}/grid/edit.action&#39;,
      loadError : function(xhr,st,err) { 
          console.log(&#39;display error : &#39;+err);  
          jq("#rsperror").html("Type: "+st+"; Response: "+ xhr.status + " "+xhr.statusText);

      },
      loadComplete: function() {
   },
      jsonReader : {
          root: "rows",
          page: "page",
          total: "total",
          records: "records",
          repeatitems: false,
          cell: "cell",
          id: "id"
      }
  });
  jq("#grid").jqGrid(&#39;navGrid&#39;,&#39;#pager&#39;,
    {edit:true,add:true,del:false,search:false},
    { },
          { },
          { },
    {
        sopt:[&#39;eq&#39;, &#39;ne&#39;, &#39;lt&#39;, &#39;gt&#39;, &#39;cn&#39;, &#39;bw&#39;, &#39;ew&#39;],
           closeOnEscape: true,
            multipleSearch: true,
             closeAfterSearch: true }
  );

 });</div></pre>
<pre class="lang-php prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit1035' value='Select Code' data-codeid='sfcode1035' /></p><div class='sfcode' id='sfcode1035'><br /></div></pre>
<pre class="lang-php prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit8405' value='Select Code' data-codeid='sfcode8405' /></p><div class='sfcode' id='sfcode8405'>Please suggest me the solution for how to load json data when it has nested object in it.</div></pre>
<pre class="lang-php prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit9534' value='Select Code' data-codeid='sfcode9534' /></p><div class='sfcode' id='sfcode9534'><br /></div></pre>
]]></description>
        	        	<pubDate>Sat, 12 Apr 2014 23:12:35 +0300</pubDate>
        </item>
</channel>
</rss>