<?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: column width auto resize</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/column-width-auto-resize</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/help/column-width-auto-resize/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on column width auto resize</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/column-width-auto-resize#p31126</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/column-width-auto-resize#p31126</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Â </p>
<p>Thanks for posting this solution.</p>
<p>Â </p>
<p>Best Regards</p>
]]></description>
        	        	<pubDate>Sat, 13 Sep 2014 13:31:50 +0300</pubDate>
        </item>
        <item>
        	<title>pphillips001 on column width auto resize</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/column-width-auto-resize#p31109</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/column-width-auto-resize#p31109</guid>
        	        	<description><![CDATA[<p>I don't know if you managed to find a solution, however here is my approach to variable column widths based on column contents.</p>
<p>Add this to the gridComplete event :</p>
<blockquote>
<p>
$(this).parent().append('&#60;span id="widthTest" /&#62;');</p>
<p>gridName = this.id;</p>
<p>$('#gbox_' + gridName + ' .ui-jqgrid-htable,#' + gridName).css('width', 'inherit');<br />
 $('#' + gridName).parent().css('width', 'inherit');</p>
<p>var columnNames = $("#" + gridName).jqGrid('getGridParam', 'colModel');<br />
 var thisWidth;</p>
<p>// Loop through Cols<br />
 for (var itm = 0, itmCount = columnNames.length; itm &#60; itmCount; itm++) {</p>
<p>var curObj = $('[aria-describedby=' + gridName + '_' + columnNames[itm].name + ']');</p>
<p>var thisCell = $('#' + gridName + '_' + columnNames[itm].name + ' div');<br />
 $('#widthTest').html(thisCell.text()).css({<br />
 'font-family': thisCell.css('font-family'),<br />
 'font-size': thisCell.css('font-size'),<br />
 'font-weight': thisCell.css('font-weight')<br />
 });<br />
 var maxWidth = Width = $('#widthTest').width() + 24;<br />
 //var maxWidth = 0;</p>
<p>// Loop through Rows<br />
 for (var itm2 = 0, itm2Count = curObj.length; itm2 &#60; itm2Count; itm2++) {<br />
 var thisCell = $(curObj[itm2]);</p>
<p>$('#widthTest').html(thisCell.html()).css({<br />
 'font-family': thisCell.css('font-family'),<br />
 'font-size': thisCell.css('font-size'),<br />
 'font-weight': thisCell.css('font-weight')<br />
 });</p>
<p>thisWidth = $('#widthTest').width();<br />
 if (thisWidth &#62; maxWidth) maxWidth = thisWidth;<br />
 }</p>
<p>$('#' + gridName + ' .jqgfirstrow td:eq(' + itm + '), #' + gridName + '_' + columnNames[itm].name).width(maxWidth).css('min-width', maxWidth);</p>
<p>}</p>
<p>$('#widthTest').remove();</p>
</blockquote>
<p>Â </p>
<p>Here's a working example :Â <a href="http://jsfiddle.net/Ba5yK/17/" rel="nofollow" target="_blank">http://jsfiddle.net/Ba5yK/17/</a></p>
<p>Regards,</p>
<p>Â </p>
<p>Paul</p>
]]></description>
        	        	<pubDate>Wed, 10 Sep 2014 11:31:47 +0300</pubDate>
        </item>
        <item>
        	<title>bahareeh on column width auto resize</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/column-width-auto-resize#p30265</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/column-width-auto-resize#p30265</guid>
        	        	<description><![CDATA[<p>After some progress, I found that if I change&#160;<strong>table-layout:fixed</strong>&#160;to&#160;<strong>table-layout:auto</strong>, the column width will fit with the content of that cell. But when I did that, the header is not aligned with the columns any more. Please help if you can.</p>
]]></description>
        	        	<pubDate>Fri, 21 Feb 2014 05:56:34 +0200</pubDate>
        </item>
        <item>
        	<title>bahareeh on column width auto resize</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/column-width-auto-resize#p30263</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/column-width-auto-resize#p30263</guid>
        	        	<description><![CDATA[<p>How to change the column width dynamically according to the content of that column. Is there a specific widget? I would be thankful if you help me. I tried shrinkToFit and autoWidth but those didn&#39;t work for me.</p>
]]></description>
        	        	<pubDate>Wed, 19 Feb 2014 21:59:35 +0200</pubDate>
        </item>
</channel>
</rss>