<?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: Change column width onCellSelect</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/change-column-width-oncellselect</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/change-column-width-oncellselect/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>sibbim on Change column width onCellSelect</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/change-column-width-oncellselect#p22864</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/change-column-width-oncellselect#p22864</guid>
        	        	<description><![CDATA[</p>
<p>Hi everybody,</p>
</p>
<p>I need your help. I want to change the width of a column after I clicked on a cell. Why?</p>
</p>
<p>The grid shows "short" values and when I click on a cell, the edit mode will be started with drop down boxes showing the "long" value to make it more easy to the user to understand the value.</p>
<p>The following code changes already the column header - but leaves the rest of the column at the old width.</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3696' value='Select Code' data-codeid='sfcode3696' /></p>
<div class='sfcode' id='sfcode3696'>onCellSelect: function(rowid, iCol, cellcontent, e){</p>
<p>&#160;&#160; colWidth = $( &#34;.edit-cell select&#34; ).css(&#39;width&#39;);</p>
<p>&#160;&#160; $(&#39;#col_name&#39;).css(&#34;width&#34;, colWidth + &#34;px&#34;);<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; <br />&#160;&#160; var colId = iCol-2;<br />&#160;&#160; if (columnHeader[3][colId] == true) {<br />&#160;&#160;&#160;&#160;&#160; $( &#34;.edit-cell select&#34; ).jec({useExistingOptions: true});<br />&#160;&#160; }&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;},</p>
</div>
<p>I also found a function called...</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit889' value='Select Code' data-codeid='sfcode889' /></p>
<div class='sfcode' id='sfcode889'>setColWidth();</div>
<p>...but it doesn&#39;t work (maybe because I don&#39;t know how to use it)</p>
</p>
<p>I also analysed the jqgrid source for the resize-stop event and found:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9354' value='Select Code' data-codeid='sfcode9354' /></p>
<div class='sfcode' id='sfcode9354'>
<p>$(&#39;table:first&#39;,this.bDiv).css(&#34;width&#34;,p.tblwidth+&#34;px&#34;);<br />$(&#39;table:first&#39;,this.hDiv).css(&#34;width&#34;,p.tblwidth+&#34;px&#34;);</p>
</p>
</div>
<p>But I don&#39;t know how to use it 🙁 Yes ok, I&#39;m still a little bit new to jqgrid.</p>
</p>
<p>Thank you very much for your help.</p>
</p>
<p>Sebastian</p>
]]></description>
        	        	<pubDate>Tue, 19 Apr 2011 14:23:26 +0300</pubDate>
        </item>
</channel>
</rss>