<?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 not displaying data</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/subgrid-not-displaying-data</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-not-displaying-data/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>sagana on Subgrid not displaying data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/subgrid-not-displaying-data#p23313</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/subgrid-not-displaying-data#p23313</guid>
        	        	<description><![CDATA[<p>I have the subgrid working in other sites and see the json returned is in the same format as I describe above so I am stumped as to why it is not working here. Besides, the only control I have over the json produced is to tell the grid $grid-&#62;dataType = &#39;json&#39;; . I cannot see what is different that is stopping it from working.</p>
]]></description>
        	        	<pubDate>Wed, 25 May 2011 11:31:39 +0300</pubDate>
        </item>
        <item>
        	<title>crilla86 on Subgrid not displaying data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/subgrid-not-displaying-data#p23193</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/subgrid-not-displaying-data#p23193</guid>
        	        	<description><![CDATA[<p>Hi. i&#39;m using the subgrid too.</p>
<p>Maybe your problem is related to json because you return a bad json.</p>
<p>The correct formatted json that you return should be like this:</p>
<pre><p><input type='button' class='sfcodeselect' name='sfselectit135' value='Select Code' data-codeid='sfcode135' /></p><div class='sfcode' id='sfcode135'>{"rows":[{"cell":[</div>"CSBM ","Query","2009","A"<p><input type='button' class='sfcodeselect' name='sfselectit7731' value='Select Code' data-codeid='sfcode7731' /></p><div class='sfcode' id='sfcode7731'>]},<br />{"cell":[</div>"FSB ","Query","",""<p><input type='button' class='sfcodeselect' name='sfselectit3735' value='Select Code' data-codeid='sfcode3735' /></p><div class='sfcode' id='sfcode3735'>]}]}.<br /><br /><br />Ps: sorry for my bad english.</div></pre>
]]></description>
        	        	<pubDate>Mon, 16 May 2011 10:57:53 +0300</pubDate>
        </item>
        <item>
        	<title>sagana on Subgrid not displaying data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/subgrid-not-displaying-data#p23171</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/subgrid-not-displaying-data#p23171</guid>
        	        	<description><![CDATA[<p>The grid works. The + opens the subgrid correctly and displays the header row. The correct number of rows display in the subgrid but are empty despite the correct json being created as displayed in firebug.</p>
<p>Code snippet for grid:-</p>
<p>// Create the jqGrid instance<br />$grid = new jqGridRender($conn);<br />// Write the SQL Query<br />// We suppose that mytable exists in your database<br />$grid-&#62;SelectCommand = "select uid,lastname,firstname,phonehome,phonework,mobile from students ".$where;</p>
<p>// set the ouput format to json<br />$grid-&#62;dataType = &#39;json&#39;;<br />// Let the grid create the model<br />$grid-&#62;setColModel();<br />// Set the url from where we obtain the data<br />$grid-&#62;setUrl(&#39;students/getstudents.php&#39;);<br />// Set grid caption using the option caption<br />$grid-&#62;setGridOptions(array(<br />&#160;&#160;&#160; "caption"=&#62;"Students and their Courses",<br />&#160;&#160;&#160; "rowNum"=&#62;16,<br />&#160;&#160;&#160; "sortname"=&#62;"lastname",<br />&#160;&#160;&#160; "rowList"=&#62;array(16,30,50),<br />&#160;&#160; &#160;"height"=&#62;354,<br />&#160;&#160; &#160;"width"=&#62;900<br />&#160;&#160;&#160; ));</p>
<p>$grid-&#62;addCol(array("name"=&#62;"act"),"first");</p>
<p>// Change some property of the field(s)<br />$grid-&#62;setColProperty("uid", array("label"=&#62;"ID", "width"=&#62;20, "hidden"=&#62;true));<br />$grid-&#62;setColProperty("act", array("label"=&#62;"Actions", "width"=&#62;90));<br />$grid-&#62;setColProperty("lastname", array("label"=&#62;"Last Name", "width"=&#62;200));<br />$grid-&#62;setColProperty("firstname", array("label"=&#62;"First Name", "width"=&#62;150));<br />$grid-&#62;setColProperty("phonehome", array("label"=&#62;"Phone Home", "width"=&#62;150));<br />$grid-&#62;setColProperty("phonework", array("label"=&#62;"Phone Work", "width"=&#62;150));<br />$grid-&#62;setColProperty("mobile", array("label"=&#62;"Mobile", "width"=&#62;150));</p>
<p>$grid-&#62;setSubGrid("students/getcourses.php",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; array(&#39;Course&#39;,&#39;Status&#39;,&#39;Year&#39;,&#39;Semester&#39;),<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; array(300,150,40,50),<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; array(&#39;left&#39;,&#39;left&#39;,&#39;right&#39;,&#39;center&#39;));</p>
</p>
<p>Code for subgid</p>
<p>require_once &#39;../includes/jquery/jq-config.php&#39;;<br />// include the jqGrid Class<br />require_once "../includes/jquery/php/jqGrid.php";<br />// include the PDO driver class<br />require_once "../includes/jquery/php/jqGridPdo.php";<br />// Connection to the server<br />$conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);</p>
<p>// Get the needed parameters passed from the main grid<br />$rowid = jqGridUtils::Strip($_REQUEST["id"]);<br />if(!$rowid) die("Missed parameters"); </p>
<p>// Create the jqGrid instance<br />$grid = new jqGrid($conn);<br />// Write the SQL Query<br />$grid-&#62;SubgridCommand = "select courses.course, studcourse.status, courses.year, courses.semester from studcourse, courses where studcourse.studentno =".$rowid." and studcourse.courseno = courses.uid";</p>
<p>// set the ouput format to json<br />$grid-&#62;dataType = &#39;json&#39;;<br />// Use the build in function for the simple subgrid<br />$grid-&#62;querySubGrid(array(&#38;$rowid));<br />$conn = null;&#160;</p>
<p>json returned by subgrid code</p>
</p>
<p>{"rows":[{"course":"CSBM ","status":"Query","year":"2009","semester":"A"},</p>
<p>{"course":"FSB ","status":"Query","year":"","semester":""}]}</p>
</p>
<p>Can someone please tell me why these records are not being displayed in the subgrid.</p>
]]></description>
        	        	<pubDate>Sat, 14 May 2011 00:20:50 +0300</pubDate>
        </item>
</channel>
</rss>