<?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: json data (jsonReader/colName) question</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/json-data-jsonreadercolname-question</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/json-data-jsonreadercolname-question/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>&#124;Evgeny&#124; on json data (jsonReader/colName) question</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/json-data-jsonreadercolname-question#p19530</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/json-data-jsonreadercolname-question#p19530</guid>
        	        	<description><![CDATA[<p>Hi, I&#39;m having problems getting JSON&#160;data to display in the grid. I&#39;ve checked forum topic <a class="sficon sfpath" href="/blog/?page_id=393/help/no-data-is-displaying-in-my-grid/" target="_blank">No data is displaying in my grid</a>&#160;but I didn&#39;t understand how it&#39;s work. Unfortunataly page Demo-&#62;Data Optimization does not contain grid which should be use example json ( smaller data).</p>
<p>Would someone please help figure out how to setup jsonReader and colModel&#160;mapping.</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3118' value='Select Code' data-codeid='sfcode3118' /></p>
<div class='sfcode' id='sfcode3118'>datasetTest = {&#34;label&#34;: &#34;Content (Created)&#34;, &#34;data&#34;: [[1277942400000, 11], [1278028800000, 1]]}</div>
<p><input type='button' class='sfcodeselect' name='sfselectit8054' value='Select Code' data-codeid='sfcode8054' /></p>
<div class='sfcode' id='sfcode8054'>var curId = 0;<br /> jQuery(&#34;#DataGrid&#34;).jqGrid({<br /> datatype: &#34;local&#34;,<br /> height: &#39;auto&#39;,<br /> width:450,<br /> rowNum:100,<br /> colNames:[&#39;date&#39;,&#39;count&#39;],<br /> colModel:[ {name:&#39;date&#39;,index:&#39;date&#39;, width:100}, {name:&#39;count&#39;,index:&#39;count&#39;, width:100} ],       multiselect: true,  	<br /> jsonReader : {<br /> root: function (obj) { return obj.data;},<br /> cell: function (obj) { return obj; },<br /> id: function (obj) { curId++; return curId; },<br /> page: function (obj) { return 1; },<br /> total: function (obj) { return 1; },<br /> records: function (obj) { return obj.data.length; }<br /> },          caption: &#34;Manipulating Array Data&#34;      }); <br /> function LoadGridTest(datasets) {          for(var i=0;i&#60;=datasets.length;i++) {                jQuery(&#34;#DataGridTest&#34;).jqGrid(&#39;addRowData&#39;,i+1,datasets[i]);          }     }          <br /> LoadGridTest(datasetTest);</div>
<p>This is code does not work. Is it possible to call to the required field in the ColModel via data[0] -&#62;1277942400000, and data[1] -&#62; 11.</p>
</p>
<p>My existing json data look like :</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7964' value='Select Code' data-codeid='sfcode7964' /></p>
<div class='sfcode' id='sfcode7964'>datasetTest = {<br />&#34;Content (Created)&#34;:{&#34;label&#34;: &#34;Content (Created)&#34;, &#34;data&#34;: [[1277942400000, 11], [1278028800000, 1]]},<br /> &#34;Content (Modified)&#34;:{&#34;label&#34;: &#34;Content (Modified)&#34;, &#34;data&#34;: [[1277942400000, 10], [1278028800000, 15]]}<br /> }</div>
<p>Is it possible to create jsGrid look like (How to configure jsonReader and colModel mapping ):</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7801' value='Select Code' data-codeid='sfcode7801' /></p>
<div class='sfcode' id='sfcode7801'>
<p>&#124;Lable &#160; &#160; &#160; &#160; &#160; &#160; &#124;Date &#160; &#160; &#160;&#124;Count&#124;</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />&#124;Content (Modified)&#124;1278028800000&#124;15&#124;</p>
<p>&#124;Content (Modified)&#124;1277942400000&#124;10&#124;</p>
<p>&#124;Content (Created) &#124;1278028800000&#124;1 &#124;</p>
<p>&#124;Content (Created) &#124;1277942400000&#124;11&#124;</p>
</div>
<p>Any help will be appreciated.</p>
<p>Thanks.</p>
]]></description>
        	        	<pubDate>Sat, 04 Sep 2010 15:30:50 +0300</pubDate>
        </item>
</channel>
</rss>