<?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: subgrid is not displaying the data it gets.</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/subgrid-is-not-displaying-the-data-it-gets</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/subgrid-is-not-displaying-the-data-it-gets/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tedbyers on subgrid is not displaying the data it gets.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/subgrid-is-not-displaying-the-data-it-gets#p27928</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/subgrid-is-not-displaying-the-data-it-gets#p27928</guid>
        	        	<description><![CDATA[<p>jqgrid is quickly becoming one of my favourite grids, but, sometimes I have a little trouble.&#160; Here is how my latest grid is created:</p>
</p>
<p style="padding-left: 30px;">$(function() {</p>
<div class="sourceRow " style="padding-left: 30px;">$( "#transhist" ).jqGrid({</div>
<div class="sourceRow " style="padding-left: 30px;">url:&#39;/cgi-bin/transaction.history.pl?tid=93e9113ad026a226f3f2dea0afdc6f9e05dc3933authREITUMU&#39;,</div>
<div class="sourceRow " style="padding-left: 30px;">datatype: &#39;xml&#39;,</div>
<div class="sourceRow " style="padding-left: 30px;">mtype: &#39;GET&#39;,</div>
<div class="sourceRow " style="padding-left: 30px;">colNames:[&#39;Transaction Id&#39;,&#39;Date&#39;, &#39;Transaction Type&#39;, &#39;Transaction result&#39;, &#39;Amount&#39;],</div>
<div class="sourceRow " style="padding-left: 30px;">colModel :[</div>
<div class="sourceRow " style="padding-left: 30px;">{name:&#39;transaction_id&#39;,index:&#39;transaction_id&#39;,width:120},</div>
<div class="sourceRow " style="padding-left: 30px;">{name:&#39;transaction_date&#39;,index:&#39;transaction_date&#39;,width:180,align:&#39;center&#39;},</div>
<div class="sourceRow " style="padding-left: 30px;">{name:&#39;action_type&#39;,index:&#39;action_type&#39;,width:120},</div>
<div class="sourceRow " style="padding-left: 30px;">{name:&#39;success&#39;,index:&#39;success&#39;,width:100,align:&#39;center&#39;},</div>
<div class="sourceRow " style="padding-left: 30px;">{name:&#39;amount&#39;,index:&#39;amount&#39;,width:80,align:&#39;right&#39;},</div>
<div class="sourceRow " style="padding-left: 30px;">],</div>
<div class="sourceRow " style="padding-left: 30px;">pager: &#39;#transpager&#39;,</div>
<div class="sourceRow " style="padding-left: 30px;">altRows: true,</div>
<div class="sourceRow " style="padding-left: 30px;">rowNum:15,</div>
<div class="sourceRow " style="padding-left: 30px;">rowList:[15,30,45],</div>
<div class="sourceRow " style="padding-left: 30px;">sortname: &#39;transaction_date&#39;,</div>
<div class="sourceRow " style="padding-left: 30px;">sortorder: &#39;desc&#39;,</div>
<div class="sourceRow " style="padding-left: 30px;">pgbuttons: true,</div>
<div class="sourceRow " style="padding-left: 30px;">gridview: true,</div>
<div class="sourceRow " style="padding-left: 30px;">width: 950,</div>
<div class="sourceRow " style="padding-left: 30px;">height: 400,</div>
<div class="sourceRow " style="padding-left: 30px;">onSelectRow: function (id) {</div>
<div class="sourceRow " style="padding-left: 30px;">var grid = jQuery(&#39;#transhist&#39;);</div>
<div class="sourceRow " style="padding-left: 30px;">var sel_id = grid.jqGrid(&#39;getGridParam&#39;, &#39;selrow&#39;);</div>
<div class="sourceRow " style="padding-left: 30px;">var cont = grid.getCell(sel_id, &#39;transaction_id&#39;);</div>
<div class="sourceRow " style="padding-left: 30px;">window.open(&#39;<a href="https://secure.profitorius.com/cgi-bin/transaction.details.report.pl?tid=&#038;#39" rel="nofollow" target="_blank">https://secure.profitorius.com/cgi-bin/transaction.details.report.pl?tid=&#038;#39</a>; + cont);</div>
<div class="sourceRow " style="padding-left: 30px;">},</div>
<div class="sourceRow " style="padding-left: 30px;">multiselect: false,</div>
<div class="sourceRow " style="padding-left: 30px;">subGrid : true,</div>
<div class="sourceRow " style="padding-left: 30px;">subGridUrl: &#39;/cgi-bin/transaction.history.subgrid.pl&#39;,</div>
<div class="sourceRow " style="padding-left: 30px;">subGridModel: [{ name : [&#39;Transaction Id&#39;,&#39;Date&#39;, &#39;Transaction Type&#39;, &#39;Transaction result&#39;, &#39;Amount&#39;],</div>
<div class="sourceRow " style="padding-left: 30px;">width : [120,180,120,100,80]}],</div>
<div class="sourceRow " style="padding-left: 30px;">caption: &#39;Basic Transaction Data&#39;</div>
<div class="sourceRow " style="padding-left: 30px;">});</div>
<div class="sourceRow " style="padding-left: 30px;">});</div>
</p>
<p>This displays OK, unless I try to get the subgrid for one of my transactions.&#160; Then, I get only the subgrid&#39;s column titles and no data.&#160; This is expected for most transactions, as few have multiple trnsactions.&#160; However, here is a sample of the XML my perl CGI script produces.</p>
<p style="padding-left: 30px;">&#60;?xml version=&#39;1.0&#39; encoding=&#39;latin1&#39;?&#62;</p>
<p style="padding-left: 30px;">&#60;rows&#62;</p>
<p style="padding-left: 60px;">&#60;row&#62;</p>
<p style="padding-left: 90px;">&#60;cell&#62;1a294c474ef117d52b1dd3aba0b60f34606d822ccapRITUMI&#60;/cell&#62;</p>
<p style="padding-left: 90px;">&#60;cell&#62;2012-12-11 15:50:07&#60;/cell&#62;&#60;cell&#62;capture&#60;/cell&#62;&#60;cell&#62;1&#60;/cell&#62;</p>
<p style="padding-left: 90px;">&#60;cell&#62;15.00&#60;/cell&#62;</p>
<p style="padding-left: 60px;">&#60;/row&#62;</p>
<p style="padding-left: 30px;">&#60;/rows&#62;</p>
<p>Yet, even with this XML, I get only the subgrid&#39;s column headers and no data.</p>
</p>
<p>This is the last bit of the puzzle for this particular page.&#160; All else is working flawlessly, including making use of our customized jQuery CSS files.</p>
<p>How do I get jqgrid&#39;s subgrid to actually display the data when there is data?&#160; Or, equally likely; what mistake did I make in setting up this subgrid?</p>
</p>
<p>Thanks</p>
</p>
<p>Ted</p>
]]></description>
        	        	<pubDate>Tue, 18 Dec 2012 04:32:34 +0200</pubDate>
        </item>
</channel>
</rss>