<?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: height:"auto" works wrong in IE, height:"100%" works correct</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/heightauto-works-wrong-in-ie-height100-works-correct</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/heightauto-works-wrong-in-ie-height100-works-correct/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on height:"auto" works wrong in IE, height:"100%" works correct</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/heightauto-works-wrong-in-ie-height100-works-correct#p22588</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/heightauto-works-wrong-in-ie-height100-works-correct#p22588</guid>
        	        	<description><![CDATA[<p>Hello Oleg,</p>
<p>Thanks.</p>
<p>It seems that this is not a bug in IE, but in grid.</p>
<p><a href="https://github.com/tonytomov/jqGrid/commit/5afb95925f29ee57e183314a8835ac053c6cec1a" target="_blank">https://github.com/tonytomov/jqGrid/commit/5afb95925f29ee57e183314a8835ac053c6cec1a</a></p>
</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Tue, 29 Mar 2011 16:28:29 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on height:"auto" works wrong in IE, height:"100%" works correct</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/heightauto-works-wrong-in-ie-height100-works-correct#p22557</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/heightauto-works-wrong-in-ie-height100-works-correct#p22557</guid>
        	        	<description><![CDATA[<p>Hello Tony,</p>
<p>I&#160;became&#160;almost&#160;crazy during analysing some strange behavior of one grid: the pager layer "danced" to the bottom on every changing of focus from one grid cell to another:</p>
<p><a href="http://www.ok-soft-gmbh.com/jqGrid/IE-height-auto-bug.png"><img src="http://www.ok-soft-gmbh.com/jqGrid/IE-height-auto-bug.png" width="100"  class="sfimageleft spUserImage" alt="" /><img src="http://www.trirand.com/blog/wp-content/sp-resources/forum-themes/default/images/sp_Mouse.png" class="sfimageleft sfmouseleft" alt="Image Enlarger" /></a></p>
<p>The reason of the problam was that I used&#160;<strong>height: "auto"</strong> parameter&#160;in the grid&#160;which work incorrect in case of&#160;existing the&#160;horizontal scrolling bar. I used <strong>shrinkToFit: false</strong> in my tests. The problem I could see only in <strong>IE&#160;</strong>(I used IE9 for my tests). &#160;One can see the demo which reproduce the problem&#160;<a href="http://www.ok-soft-gmbh.com/jqGrid/IE-height-auto-bug.htm" target="_blank">here</a>. You can compare the results with <a href="http://www.ok-soft-gmbh.com/jqGrid/IE-height-100percent.htm" target="_blank">the same table</a> but where &#160;<strong>height: "auto"</strong>&#160;are replaced to&#160;<strong>height: "100%"</strong>.</p>
<p>Interesting are also two next demos: <a href="http://www.ok-soft-gmbh.com/jqGrid/Height-100.htm" target="_blank">this</a> works in IE and <a href="http://www.ok-soft-gmbh.com/jqGrid/Height-auto.htm" target="_blank">another one</a> has the same problem as described above if one click on any cell of the grid:</p>
<p><a href="http://www.ok-soft-gmbh.com/jqGrid/Height-auto.png"><img src="http://www.ok-soft-gmbh.com/jqGrid/Height-auto.png" width="100"  class="sfimageleft spUserImage" alt="" /><img src="http://www.trirand.com/blog/wp-content/sp-resources/forum-themes/default/images/sp_Mouse.png" class="sfimageleft sfmouseleft" alt="Image Enlarger" /></a></p>
<p>In the last examples no JavaScripts are used. So it is IE bug. Probably one can fix the bug with some CSS trick. I am not a CSS guru and the including of&#160;<strong>zoom:1</strong> in different places of CSS not solves the problem.</p>
<p>So I suggest another workaround in <em>grid.base.js</em>. One should just use as the height value the "100%" instead of "auto" in the definition of the <strong>div.ui-jqgrid-bdiv</strong>. I suggest to change the lines <a href="https://github.com/tonytomov/jqGrid/blob/master/js/grid.base.js#L2300" target="_blank">2300-2304</a>&#160;of grid.base.js:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3416' value='Select Code' data-codeid='sfcode3416' /></p>
<div class='sfcode' id='sfcode3416'>$(grid.bDiv)<br />&#160;&#160; &#160;.append($(&#39;&#60;div style=&#34;position:relative;&#39;+(isMSIE &#38;&#38; $.browser.version &#60; 8 ? &#34;height:0.01%;&#34; : &#34;&#34;)+&#39;&#34;&#62;&#60;/div&#62;&#39;).append(&#39;&#60;div&#62;&#60;/div&#62;&#39;).append(this))<br />&#160;&#160; &#160;.addClass(&#34;ui-jqgrid-bdiv&#34;)<br />&#160;&#160; &#160;.css({ height: ts.p.height+(isNaN(ts.p.height)?&#34;&#34;:&#34;px&#34;), width: (grid.width)+&#34;px&#34;})<br />&#160;&#160; &#160;.scroll(grid.scrollGrid);&#160;</div>
<p>to</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1698' value='Select Code' data-codeid='sfcode1698' /></p>
<div class='sfcode' id='sfcode1698'><strong>var gheight = String(ts.p.height).toLowerCase() === &#34;auto&#34; ? &#34;100%&#34;: ts.p.height;</strong><br />$(grid.bDiv)<br />&#160;&#160; &#160;.append($(&#39;&#60;div style=&#34;position:relative;&#39;+(isMSIE &#38;&#38; $.browser.version &#60; 8 ? &#34;height:0.01%;&#34; : &#34;&#34;)+&#39;&#34;&#62;&#60;/div&#62;&#39;).append(&#39;&#60;div&#62;&#60;/div&#62;&#39;).append(this))<br />&#160;&#160; &#160;.addClass(&#34;ui-jqgrid-bdiv&#34;)<br />&#160;&#160; &#160;.css({ height: <strong>gheight</strong>+(isNaN(<strong>gheight</strong>)?&#34;&#34;:&#34;px&#34;), width: (grid.width)+&#34;px&#34;})<br />&#160;&#160; &#160;.scroll(grid.scrollGrid);&#160;</div>
<p>(The definition of new variable <strong>gheight</strong> one can move to the begining of the corresponding JavaScript function). You can see the same grid which I used befor but with the fix <a href="http://www.ok-soft-gmbh.com/jqGrid/IE-height-auto-bugfix.htm" target="_blank">here</a>.</p>
<p>For all who use jqGrid without he fix now I recommend just use <strong>height: "100%"</strong> instead of <strong>height: "auto"</strong>.</p>
<p>Best regards<br />Oleg</p>
]]></description>
        	        	<pubDate>Sat, 26 Mar 2011 17:34:30 +0200</pubDate>
        </item>
</channel>
</rss>