<?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: jqGrid - Expanding subgrid on pageload</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-expanding-subgrid-on-pageload</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/jqgrid-expanding-subgrid-on-pageload/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>ancycideve on jqGrid - Expanding subgrid on pageload</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-expanding-subgrid-on-pageload#p19927</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-expanding-subgrid-on-pageload#p19927</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>I have a Jqgrid with subgrid enabled in my MVC 2 project. Subgrid expands and populates data on the button click. I want to expand and show the subgrid data on page load. So i called exapandSubGridRow method on gridComplete event of the parent grid. Now the problem is, subgrid row is expanded on pageload, but with no data, an empty row appears below the parent grid row. Here is my code, Can anyone help me in fixing the problem.</p>
</p>
<pre class="prettyprint"><p><input type='button' class='sfcodeselect' name='sfselectit7987' value='Select Code' data-codeid='sfcode7987' /></p><div class='sfcode' id='sfcode7987'><pre class=&#34;&#34;prettyprint&#34;&#34;>&#60;script type=&#34;text/javascript&#34;&#62; <br />&#160;&#160; jQuery(document).ready(function () { <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery(&#34;#list&#34;).jqGrid({ <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; url: &#39;/jqgrid/DynamicGridData/&#39;, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype: &#39;json&#39;, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; mtype: &#39;GET&#39;, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colNames: [&#39;SurveyQnGrpId&#39;, &#39;SurveyQnGroup1&#39;], <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colModel: [ <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name:&#39;SurveyQnGrpId&#39;, index:&#39;SurveyQnGrpId&#39;, width:40, align:&#39;left&#39; }, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name:&#39;SurveyQnGroup1&#39;,index: &#39;SurveyQnGroup1&#39;,width: 400, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; align: &#39;left&#39;}], <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; pager: jQuery(&#39;#pager&#39;), <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rowNum: 10, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rowList: [5, 10, 20, 50], <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortname: &#39;SurveyQnGrpId&#39;, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortorder: &#34;SurveyQnGroup1&#34;, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; viewrecords: true, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; caption: &#39;My first grid&#39;, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; subGrid: true, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; subGridUrl: &#39;/jqgrid/InnerGridData/&#39;, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; subGridModel: [{ <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; name: [&#39;SurveyQnGrpId&#39;,&#39;SurveyQnId&#39;, &#39;SurveyQn&#39;, &#39;SurveyQnCategory&#39;, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;MandatoryQn&#39;,&#39;RadioOption3&#39;], <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; width: [10,10, 100, 10, 10,10], <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; align: [&#39;left&#39;, &#39;left&#39;, &#39;left&#39;, &#39;left&#39;], <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; params: [&#39;SurveyQnGrpId&#39;] <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }], <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; gridComplete: function () { <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var rowIds = $(&#34;#list&#34;).getDataIDs(); <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $.each(rowIds, function (index, rowId) { <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&#34;#list&#34;).expandSubGridRow(rowId);&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; });&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }); <br />&#160;&#160;&#160; }); </pre>
</div>
<p>Thanks in advance, Ancy</p>
]]></description>
        	        	<pubDate>Wed, 22 Sep 2010 15:09:38 +0300</pubDate>
        </item>
</channel>
</rss>