<?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: sortable and forceFit not working properly together</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/sortable-and-forcefit-not-working-properly-together</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/sortable-and-forcefit-not-working-properly-together/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>aexon on sortable and forceFit not working properly together</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/sortable-and-forcefit-not-working-properly-together#p24420</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/sortable-and-forcefit-not-working-properly-together#p24420</guid>
        	        	<description><![CDATA[<p>Dear community,</p>
</p>
<p>when using the options sortable and forceFit it is possible to resize the width of the inner table, which should be avoided since forceFit is set to true. To reproduce this behaviour simply create a grid with sortable and forceFit set to true and&#160;resizable colums (default), switch the last two columns by dragging and dropping them and now resize the new last column by making it smaller (works only with making it smaller). The result is a _wider_ last column and a horizontal scrollbar in the inner table (the one with the id initially given).</p>
</p>
<p>When the table is initially rendered with forceFit turned on the last column is not resizable. I think to avoid exactly such a behaviour. But together with sortable columns (don&#39;t mix it up with data sorting) this safety mechanism is bypassed. The next to last (and resizable) column becomes the last column and makes it possible to widen the table.</p>
</p>
<p>So the basic idea behind this is to make another column the last column. Another way to achieve this is using the columnChooser. Simply hide the last column and again the column next to the (former) last column becomes the new last colum, which is, of course, resizable (by default).</p>
</p>
<p>I was confronted with this behaviour earlier (version 3.6.4) and solved it by maintaining the resizable status whenever the columns are remapped or a column&#39;s visibility changes.</p>
</p>
<p>There are two places to inspect:</p>
</p>
<ol>
<li>The remapColumns function (also in the latest version of jqGrid) and</li>
<li>the afterSubmitForm event fired when closing the columnChooser (or the appropriate code in jqGrid, but I did not want to change this and handled the event instead)</li>
</ol>
<p>What needs to be done is to maintain the resizable attribute of each column and whenever a resizable column becomes the last column to change it to "not resizable" by setting the colModel attribute resizable of this column to false. Of course whenever another column becomes the last column, the changed resizable attribute needs to be restored according to it&#39;s initialization value (as defined in the colModel).</p>
</p>
<p>BR</p>
</p>
<p>Kai</p>
]]></description>
        	        	<pubDate>Fri, 26 Aug 2011 13:47:43 +0300</pubDate>
        </item>
</channel>
</rss>