<?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: Resize bug if reordering &#38; forceFit are enabled</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/resize-bug-if-reordering-forcefit-are-enabled</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/resize-bug-if-reordering-forcefit-are-enabled/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on Resize bug if reordering &#38; forceFit are enabled</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/resize-bug-if-reordering-forcefit-are-enabled#p19694</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/resize-bug-if-reordering-forcefit-are-enabled#p19694</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Thank you for this.</p>
<p>Let me see if I can fix this in a easy way.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sat, 11 Sep 2010 12:44:43 +0300</pubDate>
        </item>
        <item>
        	<title>Jarlax on Resize bug if reordering &#38; forceFit are enabled</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/resize-bug-if-reordering-forcefit-are-enabled#p19592</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/resize-bug-if-reordering-forcefit-are-enabled#p19592</guid>
        	        	<description><![CDATA[<p>I&#39;m using jqGrid v3.7.2.</p>
<p>If reordering columns is enabled and <strong>forceFit</strong>&#160;property is set to true next bug is reproducible:</p>
<p>1) Actor moves last column into middle of the grid.</p>
<p>2) He tries to resize this column, but column isn&#39;t resizable.</p>
<p>My fix was:</p>
<p>1) Set <strong>forceFit</strong>&#160;property after init of grid. This makes last column resizable but, if user tries to reduce it&#39;s size, actual size is increased and horizontal scroll appears. To fix this I&#39;ve used next workaround:</p>
<p>2) Instead of setting <strong>sortable</strong> property as boolean, set it as object:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9469' value='Select Code' data-codeid='sfcode9469' /></p>
<div class='sfcode' id='sfcode9469'>sortable: {<br /> &#160;&#160;options: {<br /> &#160;&#160; &#160;start: function (event, ui) {<br /> &#160;&#160; &#160; &#160;setLastColumnResizing(gridControl, true);<br /> &#160;&#160; &#160;},<br /> &#160;&#160; &#160;stop: function (event, ui) {<br /> &#160;&#160; &#160; &#160;setLastColumnResizing(gridControl, false);<br /> &#160;&#160; &#160;}<br /> &#160;&#160;}<br /> }</div>
<p>Where <strong>setLastColumnResizing</strong> function is:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4389' value='Select Code' data-codeid='sfcode4389' /></p>
<div class='sfcode' id='sfcode4389'>function setLastColumnResizing(grid, allowResize) {<br /> &#160;&#160;var columnName = null,<br /> &#160;&#160; &#160;resizable = null,<br /> &#160;&#160; &#160;colModel = grid.getGridParam(&#34;colModel&#34;);<br /> &#160;&#160;for (var i = colModel.length - 1; i &#62;= 0; i--) {<br /> &#160;&#160; &#160;var obj = colModel[i];<br /> &#160;&#160; &#160; &#160;if (obj.hidden == false) {<br /> &#160;&#160; &#160; &#160; &#160;columnName = obj.name;<br /> &#160;&#160; &#160; &#160; &#160;resizable = obj.resizable;<br /> &#160;&#160; &#160; &#160; &#160;break;<br /> &#160;&#160; &#160; &#160;}<br /> &#160;&#160; &#160;}<br /> &#160;&#160; &#160;if (columnName &#38;&#38; resizable == true) {<br /> &#160;&#160; &#160; &#160;var resizeMark = $(&#39;.ui-jqgrid-resize&#39;, grid.selector + &#39;_&#39; + columnName);<br /> &#160;&#160; &#160; &#160;resizeMark.css(&#34;display&#34;, allowResize ? &#34;&#34; : &#34;none&#34;);<br /> &#160;&#160;}<br /> }</div>
<p>This function also should be called right after grid initialization.</p>
<p>This is tricky workaround, so it would be great if this bug will be fixed in base jqGrid sources.</p>
]]></description>
        	        	<pubDate>Wed, 08 Sep 2010 14:42:30 +0300</pubDate>
        </item>
</channel>
</rss>