<?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: Load grid with addJSONData problem</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/load-grid-with-addjsondata-problem</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/load-grid-with-addjsondata-problem/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>HoSpiTaL_gHoSt on Load grid with addJSONData problem</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/load-grid-with-addjsondata-problem#p14710</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/load-grid-with-addjsondata-problem#p14710</guid>
        	        	<description><![CDATA[<p>Yes, I&#39;m sorry for the confusion, the array I showed you also used a jsonReader. If you don&#39;t want/need to use a jsonReader, your array should look like this:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1067' value='Select Code' data-codeid='sfcode1067' /></p>
<div class='sfcode' id='sfcode1067'>{<br />&#34;rows&#34;:[{&#39;company&#39;:&#39;1&#39;,&#39;TG_NAME&#39;:&#39;1&#39;,&#39;activeGroup&#39;:&#39;1&#39;},{&#39;company&#39;:&#39;2&#39;,&#39;TG_NAME&#39;:&#39;2&#39;,&#39;activeGroup&#39;:&#39;2&#39;}],<br />&#34;records&#34;:2,<br />&#34;total&#34;:1,<br />&#34;page&#34;:1<br />}</div>
]]></description>
        	        	<pubDate>Wed, 10 Feb 2010 18:16:01 +0200</pubDate>
        </item>
        <item>
        	<title>tony on Load grid with addJSONData problem</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/load-grid-with-addjsondata-problem#p14689</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/load-grid-with-addjsondata-problem#p14689</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>You should configure your jsonReader. Please read here how this can be achieved</p>
<p><a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:retrieving_data#json_data" rel="nofollow" target="_blank"><a href="http://www.trirand.com/jqgridw" rel="nofollow">http://www.trirand.com/jqgridw</a>.....#json_data</a></p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Wed, 10 Feb 2010 15:26:04 +0200</pubDate>
        </item>
        <item>
        	<title>mike.tihonchik on Load grid with addJSONData problem</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/load-grid-with-addjsondata-problem#p14586</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/load-grid-with-addjsondata-problem#p14586</guid>
        	        	<description><![CDATA[<p>Thank you for that information&#8230; However, i am still facing the problem. This is my code:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7630' value='Select Code' data-codeid='sfcode7630' /></p>
<div class='sfcode' id='sfcode7630'>
<p>jQuery(&#39;#terminalGroups&#39;).jqGrid({</p>
<p>datatype: &#39;json&#39;,</p>
<p>colNames: [&#39;Company&#39;,&#39;Name&#39;,&#39;Active&#39;],</p>
<p>colModel: [</p>
<p>{name:&#39;company&#39;, index:&#39;company&#39;, width:500},</p>
<p>{name:&#39;TG_NAME&#39;, index:&#39;TG_NAME&#39;, width:300},</p>
<p>{name:&#39;activeGroup&#39;, index:&#39;activeGroup&#39;, width:195} ],</p>
<p>pager: jQuery(&#39;#terminalGroupPager&#39;),</p>
<p>rowNum: 10,</p>
<p>rowList: [10,20,30],</p>
<p>sortorder: &#39;desc&#39;,</p>
<p>viewrecords: true,</p>
<p>imgpath: &#39;jquery/jqueryUI/css/sunny/images&#39;,</p>
<p>caption: &#39;Merchant Groups&#39;,</p>
<p>height: &#39;490px&#39;</p>
<p>});</p>
</p>
<p>var something = { &#34;data&#34;:[{&#39;company&#39;:&#39;1&#39;,&#39;TG_NAME&#39;:&#39;1&#39;,&#39;activeGroup&#39;:&#39;1&#39;},{&#39;company&#39;:&#39;2&#39;,&#39;TG_NAME&#39;:&#39;2&#39;,&#39;activeGroup&#39;:&#39;2&#39;}], &#34;totalRows&#34;:2, &#34;totalPages&#34;:1, &#34;page&#34;:1 };</p>
</p>
<p>jQuery(&#39;#terminalGroups&#39;)[0].addJSONData( something );</p>
</div>
<p>However, I get JS syntax error, and when I debug, it points to this code:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5299' value='Select Code' data-codeid='sfcode5299' /></p>
<div class='sfcode' id='sfcode5299'>($.jgrid.useJSON===true&#38;&#38;typeof(JSON)===&#34;object&#34;&#38;&#38;typeof(JSON.parse)===&#34;function&#34;)</div>
<p>any idea what might that be?</p>
]]></description>
        	        	<pubDate>Fri, 05 Feb 2010 18:06:25 +0200</pubDate>
        </item>
        <item>
        	<title>HoSpiTaL_gHoSt on Load grid with addJSONData problem</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/load-grid-with-addjsondata-problem#p14542</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/load-grid-with-addjsondata-problem#p14542</guid>
        	        	<description><![CDATA[<p>This is what your array should look like:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8463' value='Select Code' data-codeid='sfcode8463' /></p>
<div class='sfcode' id='sfcode8463'>{<br />&#34;data&#34;:[{&#39;company&#39;:&#39;1&#39;,&#39;TG_NAME&#39;:&#39;1&#39;,&#39;activeGroup&#39;:&#39;1&#39;},{&#39;company&#39;:&#39;2&#39;,&#39;TG_NAME&#39;:&#39;2&#39;,&#39;activeGroup&#39;:&#39;2&#39;}],<br />&#34;totalRows&#34;:2,<br />&#34;totalPages&#34;:1,<br />&#34;page&#34;:1<br />}</div>
</p>
<p>And you should call addJSONData like this:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7473' value='Select Code' data-codeid='sfcode7473' /></p>
<div class='sfcode' id='sfcode7473'>jQuery(&#39;#terminalGroups&#39;)[0].addJSONData( result );</div>
]]></description>
        	        	<pubDate>Thu, 04 Feb 2010 12:03:38 +0200</pubDate>
        </item>
        <item>
        	<title>mike.tihonchik on Load grid with addJSONData problem</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/load-grid-with-addjsondata-problem#p14535</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/load-grid-with-addjsondata-problem#p14535</guid>
        	        	<description><![CDATA[<p>Thank you for reply, but I have read that already... The problem is it does not specify much about data array (what should it look like). Here is example data what I use:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4994' value='Select Code' data-codeid='sfcode4994' /></p>
<div class='sfcode' id='sfcode4994'>var exmpl = &#34;[{&#39;company&#39;:&#39;1&#39;,&#39;TG_NAME&#39;:&#39;1&#39;,&#39;activeGroup&#39;:&#39;1&#39;},{&#39;company&#39;:&#39;2&#39;,&#39;TG_NAME&#39;:&#39;2&#39;,&#39;activeGroup&#39;:&#39;2&#39;}]&#34;;</div>
<p>This looks like a proper JS array to me...</p>
]]></description>
        	        	<pubDate>Wed, 03 Feb 2010 22:48:10 +0200</pubDate>
        </item>
        <item>
        	<title>HoSpiTaL_gHoSt on Load grid with addJSONData problem</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/load-grid-with-addjsondata-problem#p14519</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/load-grid-with-addjsondata-problem#p14519</guid>
        	        	<description><![CDATA[<p>Hi. Read the jqGrid documentation, everything is explained there! addJSONData is a special method:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1216' value='Select Code' data-codeid='sfcode1216' /></p>
<div class='sfcode' id='sfcode1216'>Populates a grid with the passed data (an array).This method should be used this way - Example: Suppose we have data from a particular webservice (jsonresponse), then <br /> var mygrid = jQuery(&#8221;#&#8221;+grid_id)[0];<br /> var myjsongrid = eval(&#8221;(&#8221;+jsonresponse.responseText+&#8221;)&#8221;); <br /> mygrid.addJSONData(myjsongrid); <br /> myjsongrid = null; <br /> jsonresponse =null;  <br /> will populate the data to the grid. And, of course, the data in myjsongrid can be manipulated before being passed to addJSONData.</div>
<p>See <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:methods" rel="nofollow" target="_blank">http://www.trirand.com/jqgridwiki/doku.php?id=wiki:methods</a></p>
]]></description>
        	        	<pubDate>Wed, 03 Feb 2010 18:14:13 +0200</pubDate>
        </item>
        <item>
        	<title>mike.tihonchik on Load grid with addJSONData problem</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/load-grid-with-addjsondata-problem#p14505</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/load-grid-with-addjsondata-problem#p14505</guid>
        	        	<description><![CDATA[<p>I am using dwr Ajax to return me a List&#60;Map&#60;String, String&#62;&#62; and I am trying to load the grid.</p>
<p>This is how I define my grid:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5004' value='Select Code' data-codeid='sfcode5004' /></p>
<div class='sfcode' id='sfcode5004'>
<p>jQuery(&#39;#terminalGroups&#39;).jqGrid({</p>
<p><span style=&#34;white-space:pre&#34;> </span>datatype: &#39;clientSide&#39;,</p>
<p><span style=&#34;white-space:pre&#34;> </span>colNames: [&#39;Company&#39;,&#39;Name&#39;,&#39;Active&#39;],</p>
<p><span style=&#34;white-space:pre&#34;> </span>colModel: [</p>
<p><span style=&#34;white-space:pre&#34;> </span>{name:&#39;company&#39;, index:&#39;company&#39;, width:500},</p>
<p><span style=&#34;white-space:pre&#34;> </span>{name:&#39;TG_NAME&#39;, index:&#39;TG_NAME&#39;, width:300},</p>
<p><span style=&#34;white-space:pre&#34;> </span>{name:&#39;activeGroup&#39;, index:&#39;activeGroup&#39;, width:195} ],</p>
<p><span style=&#34;white-space:pre&#34;> </span>pager: jQuery(&#39;#terminalGroupPager&#39;),</p>
<p><span style=&#34;white-space:pre&#34;> </span>rowNum: 10,</p>
<p><span style=&#34;white-space:pre&#34;> </span>rowList: [10,20,30],</p>
<p><span style=&#34;white-space:pre&#34;> </span>sortorder: &#39;desc&#39;,</p>
<p><span style=&#34;white-space:pre&#34;> </span>viewrecords: true,</p>
<p><span style=&#34;white-space:pre&#34;> </span>imgpath: &#39;jquery/jqueryUI/css/sunny/images&#39;,</p>
<p><span style=&#34;white-space:pre&#34;> </span>caption: &#39;Merchant Groups&#39;,</p>
<p><span style=&#34;white-space:pre&#34;> </span>height: &#39;490px&#39;</p>
<p>});</p>
</div>
<p>Now, I get a structure back from Ajax call, and I want to add it using following command:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5123' value='Select Code' data-codeid='sfcode5123' /></p>
<div class='sfcode' id='sfcode5123'>jQuery(&#39;#terminalGroups&#39;).addJSONData( result );</div>
<p>however, I get the JS error that "object does not support this property or method". However, if I iterate through "result" and use&#160;</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8581' value='Select Code' data-codeid='sfcode8581' /></p>
<div class='sfcode' id='sfcode8581'>jQuery(&#39;#terminalGroups&#39;).addRowData( &#60;%=index%&#62;, result[&#60;%=index%&#62;] );</div>
<p>it works just fine...</p>
<p>What am I doing wrong on addJSONData???</p>
]]></description>
        	        	<pubDate>Tue, 02 Feb 2010 21:49:44 +0200</pubDate>
        </item>
</channel>
</rss>