<?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: shrinkToFit is always happening for me</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/shrinktofit-is-always-happening-for-me</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/shrinktofit-is-always-happening-for-me/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>davidelewis on shrinkToFit is always happening for me</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/shrinktofit-is-always-happening-for-me#p2640</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/shrinktofit-is-always-happening-for-me#p2640</guid>
        	        	<description><![CDATA[<p>Whoops! <img class="spSmiley" style="margin:0" title="Embarassed" src="/blog/wp-content/plugins/simple-forum/tinymce/plugins/emotions/img/smiley-embarassed.gif" border="0" alt="Embarassed" /></p>
<p>I doubled checked this again ... If I set the grid width <span style="text-decoration: underline;">after</span> hiding the column, then your solution works</p>
<p><span class="sfcode">$("#grid").jqGrid({}).setGridWidth(600, false);</span></p>
<p>Thanks!</p>
]]></description>
        	        	<pubDate>Tue, 21 Oct 2008 16:11:48 +0300</pubDate>
        </item>
        <item>
        	<title>davidelewis on shrinkToFit is always happening for me</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/shrinktofit-is-always-happening-for-me#p2639</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/shrinktofit-is-always-happening-for-me#p2639</guid>
        	        	<description><![CDATA[<p>Your suggestion resizes the grid, but not the grid header (&#60;div/&#62; with the <span class="attribute-name">class</span>=<span class="attribute-value">"GridHeader"). From my example above, after hiding one of the four columns - the three remaing columns take up approx 450 pixels while the header remains 600 pixels. As soon as I resize a column, the header "snaps" to the correct width. I&#39;m guessing that the width of the hidden column (zero pixels) is not being included in the calculation of the grid header width.<br /></span></p>
<p><span class="attribute-value">Any other solutions?<br /></span></p>
]]></description>
        	        	<pubDate>Tue, 21 Oct 2008 16:08:53 +0300</pubDate>
        </item>
        <item>
        	<title>tony on shrinkToFit is always happening for me</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/shrinktofit-is-always-happening-for-me#p2591</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/shrinktofit-is-always-happening-for-me#p2591</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>$(..).jqGrid({}).setGridWidth(600,false)</p>
</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sun, 19 Oct 2008 07:41:30 +0300</pubDate>
        </item>
        <item>
        	<title>davidelewis on shrinkToFit is always happening for me</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/shrinktofit-is-always-happening-for-me#p2584</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/shrinktofit-is-always-happening-for-me#p2584</guid>
        	        	<description><![CDATA[<p>Either this problem or a related problem seems to be introduced in the 3.3 release ...</p>
<p>With jqGrid 3.2.x, if I have a grid with 4 columns, each 150 pixels wide - and&#160; the grid width is 600 pixels - when a column is hidden and the "shrinkToFit" is set to false, the grid width automatically reduces in size. <strong>With the 3.3 release, the grid does not resize smaller.</strong></p>
<p>I think that an "expandToFit" would be a great feature ... also the ability to set column with to "auto", so that the width is based on the maximum text width within a column - like a convensional HTML table.</p>
<p>Ideas?</p>
]]></description>
        	        	<pubDate>Fri, 17 Oct 2008 17:15:21 +0300</pubDate>
        </item>
        <item>
        	<title>max-williams on shrinkToFit is always happening for me</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/shrinktofit-is-always-happening-for-me#p1449</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/shrinktofit-is-always-happening-for-me#p1449</guid>
        	        	<description><![CDATA[<blockquote>
<p>&#8220;tony said:</p>
<p>I think you should use 3.2.1.&#8221;</p>
<p>Sorry tony, i thought i posted a correction saying it was 3.2.1, not 3.2.&#160; But i clearly didn&#39;t.</p>
<p>&#8220;And shrink to fit is used in oposite way - smal table width</p>
<p>many columns</p>
<p>Also do you have hidden columns?</p>
<p>Note that when shrink to fit is used the width of the hidden</p>
<p>columns is not included in the recalculation&#8221;</p>
<p>yeah -&#160; i do have hidden columns.&#160; Basically my problem was that the columns were being resized even though shrinkToFit isn&#39;t used - but in my case, like you say, the starting situation is that the total column width is less than the table width, so maybe shrinkToFit isn&#39;t relevant.&#160; It&#39;s a bit confusing though, to me at least.&#160; Maybe a new option, &#39;expandToFit&#39; is needed?&#160; <img class="wp-smiley" src="/blog/wp-includes/images/smilies/icon_smile.gif" alt=":)" /> </p>
</blockquote>
<hr />
]]></description>
        	        	<pubDate>Fri, 08 Aug 2008 07:52:51 +0300</pubDate>
        </item>
        <item>
        	<title>max-williams on shrinkToFit is always happening for me</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/shrinktofit-is-always-happening-for-me#p1448</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/shrinktofit-is-always-happening-for-me#p1448</guid>
        	        	<description><![CDATA[<p>I was thinking about this some more, and in a way it doesn&#39;t make sense to have the table bigger than the sum of the column widths.&#160; But, i still don&#39;t want to stretch all of them.&#160; So, i came up with an alternative solution - if we have &#39;width&#39; specified, and shrinkToFit = false, then we can resize ONLY THE LAST column to fit the table.&#160;</p>
<p>This works better for me, but it might not be to everyone&#39;s needs so i&#39;m posting it here for your opinion.&#160; <br />[code]</p>
<p>#grid.base.js - original version</p>
<p>#line 905 - 910<br />for(l=0;l&#60;ts.p.colModel.length;l++) { <br />&#160; if(!ts.p.shrinkToFit){ <br />&#160;&#160;&#160; ts.p.colModel[l].owidth = ts.p.colModel[l].width; <br />&#160; } <br />&#160; ts.p.colModel[l].width = Math.round(tblwidth/initwidth*ts.p.colModel[l].width); <br />}</p>
<p>#my modified version<br />if(ts.p.shrinkToFit){<br />&#160; //resize all columns to fit the table <br />&#160; for(l=0;l&#60;ts.p.colModel.length;l++) {&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160; ts.p.colModel[l].owidth = ts.p.colModel[l].width;<br />&#160;&#160;&#160; ts.p.colModel[l].width = Math.round(tblwidth/initwidth*ts.p.colModel[l].width); <br />&#160; }&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />} else {<br />&#160; //make only the last column wider to fit the table<br />&#160; ts.p.colModel[ts.p.colModel.length - 1].width += (tblwidth - initwidth);<br />}</p>
<p>[/code]</p>
<p>Thanks - max</p>
]]></description>
        	        	<pubDate>Fri, 08 Aug 2008 06:58:18 +0300</pubDate>
        </item>
        <item>
        	<title>tony on shrinkToFit is always happening for me</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/shrinktofit-is-always-happening-for-me#p1447</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/shrinktofit-is-always-happening-for-me#p1447</guid>
        	        	<description><![CDATA[<p>I think you should use 3.2.1.</p>
<p>And shrink to fit is used in oposite way - smal table width</p>
<p>many columns</p>
<p>Also do you have hidden columns?</p>
<p>Note that when shrink to fit is used the width of the hidden</p>
<p>columns is not included in the recalculation</p>
<p>Regards</p>
<p>Tony</p></p>
]]></description>
        	        	<pubDate>Fri, 08 Aug 2008 06:46:11 +0300</pubDate>
        </item>
        <item>
        	<title>max-williams on shrinkToFit is always happening for me</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/shrinktofit-is-always-happening-for-me#p1446</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/shrinktofit-is-always-happening-for-me#p1446</guid>
        	        	<description><![CDATA[<p>Probably the same bug as here -</p>
<p><a href="http://www.trirand.com/blog/?page_id=18/bugs/jqgrid-32-width-bug/page-1/post-1084/" rel="nofollow" target="_blank"><a href="http://www.trirand.com/blog/?p" rel="nofollow">http://www.trirand.com/blog/?p</a>.....post-1084/</a></p>
<p>But the circumstances are slightly different.</p>
<p>I have a width explicitly set for every column in my colModel, and i have no table width or shrinkToFit set, and that&#39;s fine - the table autosizes&#160; to the combined width of the columns in colModel. &#160;</p>
<p>However, i want the table to be a bit bigger than the combined width, so i set the &#39;width&#39; option to be larger than the total width, and set shrinkToFit: false.&#160; And then, it seems like shrinkToFit kicks in and my column widths break (it&#39;s really obvious that they break because i&#39;ve filled each cell with textfields, and they don&#39;t match the new widths).&#160; I tried setting the default value for shrinkToFit to false in the the source and it&#39;s the same.</p>
<p>In other words, if width is set, it always changes the widths of the individual columns, whether shrinkToFit is set or not. &#160; This is using version 3.2</p>
<p>Thanks!</p>
<p>max</p>
]]></description>
        	        	<pubDate>Fri, 08 Aug 2008 06:09:49 +0300</pubDate>
        </item>
</channel>
</rss>