<?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: Data not showing up, but receiving in correct format</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/data-not-showing-up-but-receiving-in-correct-format</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/data-not-showing-up-but-receiving-in-correct-format/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>drmoocow on Data not showing up, but receiving in correct format</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/data-not-showing-up-but-receiving-in-correct-format#p19242</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/data-not-showing-up-but-receiving-in-correct-format#p19242</guid>
        	        	<description><![CDATA[<p>Ok, so I solved my problem, but I don&#39;t really get why it was a problem.</p>
</p>
<p>In my jqGrid call, I had:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9168' value='Select Code' data-codeid='sfcode9168' /></p>
<div class='sfcode' id='sfcode9168'>dataType: &#34;json&#34;,</div>
</p>
<p>where, in fact, it is expecting:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9393' value='Select Code' data-codeid='sfcode9393' /></p>
<div class='sfcode' id='sfcode9393'>datatype: &#34;json&#34;,</div>
<p><img class="spSmiley" style="margin:0" title="Yell" src="/blog/wp-content/forum-smileys/sf-yell.gif" alt="Yell" /></p>
<p>Why is it that this variable is all in lower case, where other variables like colNames and colModel are in camelcase?</p>
<p>Hopefully me pulling my hair out (not that I had much to start with) will save someone else from pulling theirs out.</p></p>
]]></description>
        	        	<pubDate>Sun, 22 Aug 2010 07:05:46 +0300</pubDate>
        </item>
        <item>
        	<title>drmoocow on Data not showing up, but receiving in correct format</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/data-not-showing-up-but-receiving-in-correct-format#p19241</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/data-not-showing-up-but-receiving-in-correct-format#p19241</guid>
        	        	<description><![CDATA[<p>Hi, everyone. I know there&#39;s been threads like this in the past, but I&#39;ve tried everything and I&#39;m at my wit&#39;s end. I&#39;ve been through past threads and the wiki looking for the answer but nothing seems to be working for me.</p>
<p>I&#39;m using the 3.8 beta available on the homepage, everything seems to work ok, but no data gets inserted into the table upon retrieiving it via JSON.</p>
<p>Here&#39;s what I&#39;ve got so far:</p>
</p>
<p><strong>HTML<br /></strong></p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9842' value='Select Code' data-codeid='sfcode9842' /></p>
<div class='sfcode' id='sfcode9842'>
<p>&#60;table id=&#34;search_results&#34; class=&#34;fm_hidden&#34;&#62;&#60;/table&#62;</p>
<p>&#60;div id=&#34;pager&#34;&#62;&#60;/div&#62;</p>
</div>
<p>JS</p>
<p>First, I declare colNames and colModel arrays because I need to add or remove a column based on which user is logged in. This is in a &#60;script&#62; section that&#39;s declared in the main php file:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7089' value='Select Code' data-codeid='sfcode7089' /></p>
<div class='sfcode' id='sfcode7089'>var colNames = [&#39;Inv#&#39;, &#39;Inv Date&#39;, &#39;Paid Date&#39;, &#39;Transco&#39;, &#39;Broker&#39;, &#39;TrCo Inv#&#39;, &#39;Load #&#39;, &#39;Amount&#39;, &#39;Curr&#39;, &#39;Days&#39;, &#39;Reserve&#39;];<br />&#60;?php if ( ! $restricted ) { ?&#62; <br />&#160;&#160;&#160; colNames.push(&#39;Profit&#39;); <br />&#60;?php } ?&#62;</p>
<p>var colModel = [<br />&#160;{ name: &#39;id&#39;, index: &#39;id&#39;, width: 35, sorttype: &#39;int&#39;, summaryType:&#39;count&#39;, summartTpl: &#39;({0}) total&#39; },<br />&#160;{ name: &#39;date&#39;, index: &#39;date&#39;, width: 60, sorttype: &#39;date&#39;, formatter: &#39;date&#39;, datefmt: &#39;Y-m-d&#39; },<br />&#160;{ name: &#39;datepaid&#39;, index: &#39;datepaid&#39;, width: 60, sorttype: &#39;date&#39;, formatter: &#39;date&#39;, datefmt: &#39;Y-m-d&#39; },<br />&#160;{ name: &#39;transco_name&#39;, index: &#39;transco_name&#39;, width: 170 },<br />&#160;{ name: &#39;broker_name&#39;, index: &#39;broker_name&#39;, width: 170 },<br />&#160;{ name: &#39;tinvid&#39;, index: &#39;tinvid&#39;, width: 50 },<br />&#160;{ name: &#39;loadno&#39;, index: &#39;loadno&#39;, width: 70 },<br />&#160;{ name: &#39;amount&#39;, index: &#39;amount&#39;, width: 50, sorttype: &#39;number&#39;, formatter: &#39;number&#39;, summaryType: &#39;sum&#39; },<br />&#160;{ name: &#39;currency&#39;, index: &#39;currency&#39;, width: 40 },<br />&#160;{ name: &#39;days&#39;, index: &#39;days&#39;, width: 40, sorttype: &#39;number&#39;, formatter: &#39;number&#39; },<br />&#160;{ name: &#39;reserve&#39;, index: &#39;reserve&#39;, width: 50, sorttype: &#39;number&#39;, formatter: &#39;number&#39;, summaryType: &#39;sum&#39;}<br />];<br />&#60;?php if ( ! $restricted ) { ?&#62;<br />&#160;&#160;&#160; colModel.push( { name: &#39;profit&#39;, index: &#39;profit&#39;, width: 50, sorttype: &#39;number&#39;, formatter: &#39;number&#39;, summaryType: &#39;sum&#39; } );<br />&#60;?php } ?&#62;</p>
</div>
<p>In the external javascript file, the function I use to call the grid and gather the search criteria builds the url and stores it in the "url" variable. In the interest of not making a mess, just assume that the url builds correctly (as it does).</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5551' value='Select Code' data-codeid='sfcode5551' /></p>
<div class='sfcode' id='sfcode5551'>
<p>jQuery(&#34;#search_results&#34;).jqGrid( { <br />&#160;&#160;&#160; url: url, <br />&#160;&#160;&#160; dataType: &#34;json&#34;, <br />&#160;&#160;&#160; colNames: colNames, <br />&#160;&#160;&#160; colModel: colModel,<br />&#160;&#160;&#160; rowNum: 1, <br />&#160;&#160;&#160; rowList: [1,10,25,50], <br />&#160;&#160;&#160; height: &#39;auto&#39;, <br />&#160;&#160;&#160; pager: &#39;#pager&#39;, <br />&#160;&#160;&#160; viewrecords: true, <br />} );<br />jQuery(&#34;#search_results&#34;).jqGrid(&#39;navGrid&#39;,&#39;#pager&#39;,{edit:false,add:false,del:false});</p>
</div>
<p>JSON</p>
<p>The JSON result appears to have the correct layout. (formatted for clarity)</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7082' value='Select Code' data-codeid='sfcode7082' /></p>
<div class='sfcode' id='sfcode7082'>
<p>{<br />&#160;&#160;&#34;rows&#34;:[<br />&#160;&#160;&#160;&#160;{<br />&#160;&#160;&#160;&#160;&#160;&#160;&#34;id&#34;:&#34;50007&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#34;cell&#34;: [<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#34;52407&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#34;2007-06-27&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#34;2007-08-17&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#34;SAMPLE TRANSCO NAME&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#34;SAMPLE BROKER NAME&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#34;375&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#34;1435&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#34;$1435.00&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#34;CAD&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#34;51&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;1,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;2<br />&#160;&#160;&#160;&#160;&#160;&#160;]<br />&#160;&#160;&#160;&#160;}<br />&#160;&#160;],<br />&#160;&#160;&#34;page&#34;:&#34;1&#34;,<br />&#160;&#160;&#34;total&#34;:&#34;1275&#34;,<br />&#160;&#160;&#34;records&#34;:&#34;1275&#34;<br />}</p>
</div>
<p>I also tried naming the fields and adding <strong>jsonReader: { repeatitems: false }</strong> to the jqGrid call, same result; I also tried putting the declaration of colNames and colModel into the jqGrid call and still got the same thing.</p>
<p>I know I&#39;m missing something somewhere&#8230; but I can&#39;t figure out for the life of me where.</p>
<p>Help?</p>
<p><img class="spSmiley" style="margin:0" title="Cry" src="/blog/wp-content/forum-smileys/sf-cry.gif" alt="Cry" /> </p>
]]></description>
        	        	<pubDate>Sun, 22 Aug 2010 01:36:43 +0300</pubDate>
        </item>
</channel>
</rss>