<?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: Local Sorting with Grids as Subgrids</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/local-sorting-with-grids-as-subgrids</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/bugs/local-sorting-with-grids-as-subgrids/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on Local Sorting with Grids as Subgrids</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/local-sorting-with-grids-as-subgrids#p5765</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/local-sorting-with-grids-as-subgrids#p5765</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>I have fixed this bug. Currently it is available only in jqGrid 3.5 Alfa 2. I will publish a stable 3.4.4 version soon.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Thu, 02 Apr 2009 10:25:16 +0300</pubDate>
        </item>
        <item>
        	<title>markjtan on Local Sorting with Grids as Subgrids</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/local-sorting-with-grids-as-subgrids#p5749</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/local-sorting-with-grids-as-subgrids#p5749</guid>
        	        	<description><![CDATA[<p>Thanks for your reply.</p>
<p>The workaround that i am using now is to cause all subgrids to collapse when a sort command is called on the parent table.&#160; So, i implemented the onSortColumn() method along with adding code to the subGridRowExpanded and subGridRowCollapsed() functions to save the list of currently open subgrids as follows (this is for other users, if they would like a workaround):</p>
<p>var openSubGrids = new Object();<br />...</p>
<p>&#160;&#160;&#160; onSortCol: function (index, colIndex, sortorder)<br />&#160;&#160;&#160; {<br />&#160;&#160;&#160; &#160;&#160;&#160; // go through all subgrids and collapse them<br />&#160;&#160;&#160; &#160;&#160;&#160; for (var name in openSubGrids)<br />&#160;&#160;&#160; &#160;&#160;&#160; {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; jQuery(&#8221;#list2&#8243;).collapseSubGridRow(openSubGrids[name]);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; delete openSubGrids[name];<br />&#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160; &#160;&#160;&#160; //alert(index + &#8221; &#8221; + colIndex + &#8221; sortorder: &#8221; + sortorder);<br />&#160;&#160;&#160; },<br />&#160;&#160;&#160; subGridRowExpanded: function(subgrid_id, row_id) <br />&#160;&#160;&#160; { <br />&#160;&#160;&#160; &#160;&#160;&#160; // store the subgrid_id and row_id somewhere<br />&#160;&#160;&#160; &#160;&#160;&#160; openSubGrids[subgrid_id] = row_id;</p>
<p>&#160;&#160;&#160; },<br />&#160;&#160;&#160; subGridRowColapsed: function(subgrid_id, row_id)<br />&#160;&#160;&#160; {</p>
<p>&#160;&#160;&#160; &#160;&#160;&#160; delete openSubGrids[subgrid_id];<br />&#160;&#160;&#160; }</p>
<p>Thanks!</p>
]]></description>
        	        	<pubDate>Wed, 01 Apr 2009 14:59:00 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Local Sorting with Grids as Subgrids</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/local-sorting-with-grids-as-subgrids#p5716</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/local-sorting-with-grids-as-subgrids#p5716</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Thanks for this. It is true. Will think how to avoid this.</p>
<p>Thanks again</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Wed, 01 Apr 2009 02:26:47 +0300</pubDate>
        </item>
        <item>
        	<title>markjtan on Local Sorting with Grids as Subgrids</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/local-sorting-with-grids-as-subgrids#p5705</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/local-sorting-with-grids-as-subgrids#p5705</guid>
        	        	<description><![CDATA[<p>This is perhaps the most awesome javascript table plugin out there.&#160; Great job!</p>
</p>
<p>I am having trouble with local sorting of a parent grid when a subgrid is currently open.&#160; Both the parent grid and the subgirds are of the datatype, &#39;jsonstring&#39;.&#160; Therefore, when you call sortGrid or click the header of the grids, it wil do local sorting as opposed to server-side sorting.</p>
<p>When the above scenario occurs, i.e. attempting to sort the parent grid while a subgrid is open, it will cause an inifinit loop on the subgrid, and you will see multiple subgrids of subgrids until the browser (in my case, Firefox) crashes and no longer responds.</p>
<p>I took the subgrid as grid example and modified it to use json strings so that it can to local sorting.&#160; The following is my configuration:</p>
<p>var jsonstring = &#39;{ total: "1", page: "1", records: "10", rows: [ {r_serviceName:"MediaService2_0", r_deploymentName:"pubwsv2_axis2", amount:"124", tax:"123", total:"1234", note:"somenote" }, {r_serviceName:"LookupService", r_deploymentName:"pubwsv2_lookup", amount:"124", tax:"123", total:"1234", note:"somenote" }, {r_serviceName:"IdentityPointService", r_deploymentName:"bamwsv2_axis2", amount:"236", tax:"95", total:"654", note:"somenote" }&#160; ] }&#39;;<br />var subjsonstring = &#39;{ total: "1", page: "1", records: "10", rows: [ {sub_r_serviceName:"MediaService2_0", sub_r_deploymentName:"pubwsv2_axis2", sub_amount:"124", sub_tax:"123", sub_total:"1234", sub_note:"somenote" }, {sub_r_serviceName:"LookupService", sub_r_deploymentName:"pubwsv2_lookup", sub_amount:"124", sub_tax:"123", sub_total:"1234", sub_note:"somenote" }, {sub_r_serviceName:"IdentityPointService", sub_r_deploymentName:"bamwsv2_axis2", sub_amount:"236", sub_tax:"95", sub_total:"654", sub_note:"somenote" }&#160; ] }&#39;;</p>
<p>jQuery("#list2").jqGrid({ <br />&#160;&#160;&#160; datastr: jsonstring, <br />&#160;&#160;&#160; datatype: "jsonstring", <br />&#160;&#160;&#160; colNames:[&#39;Service Name&#39;,&#39;Deployment Name&#39;, &#39;Client&#39;, &#39;Amount&#39;,&#39;Tax&#39;,&#39;Total&#39;,&#39;Notes&#39;], <br />&#160;&#160;&#160; colModel:[ <br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;serviceName&#39;,index:&#39;r_serviceName&#39;, width:150}, <br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;deploymentName&#39;,index:&#39;deploymentName&#39;, width:140}, <br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;name&#39;,index:&#39;name asc, invdate&#39;, width:100}, <br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;amount&#39;,index:&#39;amount&#39;, sorttype:&#39;float&#39;, formatter:&#39;number&#39;, width:80, align:"right"}, <br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;tax&#39;,index:&#39;tax&#39;, sorttype:&#39;float&#39;, formatter:&#39;number&#39;, width:80, align:"right"}, <br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;total&#39;,index:&#39;total&#39;, sorttype:&#39;float&#39;, formatter:&#39;number&#39;, width:80, align:"right"}, <br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;note&#39;,index:&#39;note&#39;, width:150, sortable:false} ], <br />&#160;&#160;&#160; height:600,<br />&#160;&#160;&#160; rowNum:20, <br />&#160;&#160;&#160; rowList:[20,40,60], <br />&#160;&#160;&#160; imgpath: gridimgpath, <br />&#160;&#160;&#160; pager: jQuery(&#39;#pager2&#39;), <br />&#160;&#160;&#160; sortname: &#39;amount&#39;, <br />&#160;&#160;&#160; loadonce: true, <br />&#160;&#160;&#160; viewrecords: true, <br />&#160;&#160;&#160; search: true,<br />&#160;&#160;&#160; sortorder: "asc", <br />&#160;&#160;&#160; subGrid: true, <br />&#160;&#160;&#160; caption: "Grid as Subgrid", <br />&#160;&#160;&#160; onSortCol: function (index, colIndex, sortorder)<br />&#160;&#160;&#160; {<br />&#160;&#160;&#160; &#160;&#160;&#160; //alert(index + " " + colIndex + " sortorder: " + sortorder);<br />&#160;&#160;&#160; },<br />&#160;&#160;&#160; jsonReader:<br />&#160;&#160;&#160; {<br />&#160;&#160;&#160; &#160;&#160;&#160; repeatitems:false<br />&#160;&#160;&#160; },<br />&#160;&#160;&#160; subGridRowExpanded: function(subgrid_id, row_id) <br />&#160;&#160;&#160; { <br />&#160;&#160;&#160; &#160;&#160;&#160; var subgrid_table_id, pager_id; <br />&#160;&#160;&#160; &#160;&#160;&#160; subgrid_table_id = subgrid_id+"_t"; <br />&#160;&#160;&#160; &#160;&#160;&#160; pager_id = "p_"+subgrid_table_id; <br />&#160;&#160;&#160; &#160;&#160;&#160; $("#"+subgrid_id).html("&#60;table id=&#39;"+subgrid_table_id+"&#39; class=&#39;scroll&#39;&#62;&#60;/table&#62;&#60;div id=&#39;"+pager_id+"&#39; class=&#39;scroll&#39;&#62;&#60;/div&#62;"); <br />&#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; //alert(jQuery("#list2").getRowData(row_id)["amount"]);<br />&#160;&#160;&#160; &#160;&#160;&#160; //alert(row_id);<br />&#160;&#160;&#160; &#160;&#160;&#160; jQuery("#"+subgrid_table_id).jqGrid(<br />&#160;&#160;&#160; &#160;&#160;&#160; { <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; datastr: subjsonstring, <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; datatype: "jsonstring", <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; colNames:[&#39;Service Name&#39;,&#39;Deployment Name&#39;, &#39;Client&#39;, &#39;Amount&#39;,&#39;Tax&#39;,&#39;Total&#39;,&#39;Notes&#39;], <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; colModel: [ <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;sub_r_serviceName&#39;,index:&#39;sub_r_serviceName&#39;, width:150}, <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;sub_r_deploymentName&#39;,index:&#39;sub_r_deploymentName&#39;, width:140}, <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;sub_name&#39;,index:&#39;sub_name asc, invdate&#39;, width:100}, <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;sub_amount&#39;,index:&#39;sub_amount&#39;, sorttype:&#39;float&#39;, formatter:&#39;number&#39;, width:80, align:"right"}, <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;sub_tax&#39;,index:&#39;sub_tax&#39;, sorttype:&#39;float&#39;, formatter:&#39;number&#39;, width:80, align:"right"}, <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;sub_total&#39;,index:&#39;sub_total&#39;, sorttype:&#39;float&#39;, formatter:&#39;number&#39;, width:80, align:"right"}, <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;sub_note&#39;,index:&#39;sub_note&#39;, width:150, sortable:false} ], <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; rowNum:20, <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; pager: pager_id, <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; imgpath: gridimgpath, <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; jsonReader:<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; repeatitems:false<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; },<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; loadonce: true,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; height: &#39;100%&#39; <br />&#160;&#160;&#160; &#160;&#160;&#160; }).navGrid("#"+pager_id,{edit:false,add:false,del:false})<br />&#160;&#160;&#160; },</p>
]]></description>
        	        	<pubDate>Tue, 31 Mar 2009 15:26:52 +0300</pubDate>
        </item>
</channel>
</rss>