<?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: JQGridState + JQGrid.min : can't hide/show more than the first column</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/jqgridstate-jqgrid-min-cant-hideshow-more-than-the-first-column</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/jqgridstate-jqgrid-min-cant-hideshow-more-than-the-first-column/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>fredpeaks on JQGridState + JQGrid.min : can't hide/show more than the first column</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/jqgridstate-jqgrid-min-cant-hideshow-more-than-the-first-column#p20674</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/jqgridstate-jqgrid-min-cant-hideshow-more-than-the-first-column#p20674</guid>
        	        	<description><![CDATA[<p>Hello everyone!</p>
<p>Firstly i would like to thanks the authors of JQGrid, this amazing plugin!! I&#39;ve discovered it a few days ago and i don&#39;t have the english words (i&#39;m french <img class="spSmiley" style="margin:0" title="Laugh" src="/blog/wp-content/forum-smileys/sf-laugh.gif" alt="Laugh" />) to tell you how much this is good. Thanks a lot!</p>
<p>I&#39;ve found a little problem when using it with JQGridState (1.1.0) and the minified version of JQGrid. When i try to hide or show columns, it only works with the first one but there is no javascript error. The others columns don&#39;t change.</p>
<p>I&#39;ve looked in the extended version and compared it with the minified version and i&#39;ve found a problem with a "for" loop on the colmodel which breaks after the first element.</p>
<p>The loop is in grid.setcolumns.js on line 76 (on extended version of course):</p>
<p>for(i=0;i&#60;$t.p.colModel.length;i++){<br />&#160; &#160;&#160; if(!$t.p.colModel[i].hidedlg) { // added from T. Tomov<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160; var nm = $t.p.colModel[i].name.replace(/\./g, "\\.");<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160; if($("#col_" + nm,"#"+dtbl).attr("checked")) {<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $($t).jqGrid("showCol",$t.p.colModel[i].name);<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#col_" + nm,"#"+dtbl).attr("defaultChecked",true); // Added from T. Tomov IE BUG<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160; } else {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160; $($t).jqGrid("hideCol",$t.p.colModel[i].name);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; $("#col_" + nm,"#"+dtbl).attr("defaultChecked",""); // Added from T. Tomov IE BUG<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160; }</p>
<p>}</p>
</p>
<p>I thought it was a variable name collision problem and i&#39;ve tried to change the "i" variable with "cpti" in the minified version and everything works normaly.</p>
<p>I hope you will understand my poor english<img class="spSmiley" style="margin:0" title="Wink" src="/blog/wp-content/forum-smileys/sf-wink.gif" alt="Wink" />.</p>
<p>Thanks again</p>
</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">for(i=0;i&#60;$t.p.colModel.length;i++){<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if(!$t.p.colModel[i].hidedlg) { // added from T. Tomov<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var nm = $t.p.colModel[i].name.replace(/\./g, "\\.");<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if($("#col_" + nm,"#"+dtbl).attr("checked")) {<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;$($t).jqGrid("showCol",$t.p.colModel[i].name);<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;$("#col_" + nm,"#"+dtbl).attr("defaultChecked",true); // Added from T. Tomov IE BUG<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;} else {<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;$($t).jqGrid("hideCol",$t.p.colModel[i].name);<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;$("#col_" + nm,"#"+dtbl).attr("defaultChecked",""); // Added from T. Tomov IE BUG<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#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;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}</div>
]]></description>
        	        	<pubDate>Thu, 04 Nov 2010 22:07:07 +0200</pubDate>
        </item>
</channel>
</rss>