<?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: input width 100% with no issues during inline editing</title>
	<link>http://www.trirand.com/blog/?page_id=393/feature-request/input-width-100-with-no-issues-during-inline-editing</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/feature-request/input-width-100-with-no-issues-during-inline-editing/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>snobo on input width 100% with no issues during inline editing</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/input-width-100-with-no-issues-during-inline-editing#p11537</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/input-width-100-with-no-issues-during-inline-editing#p11537</guid>
        	        	<description><![CDATA[<p>Hello jqGrid team,</p>
<p>some time ago, in times of v 3.4.4, I suggested a way to fix the "dirty" solution employed by jqGrid when it creates an &#60;INPUT&#62; during inline cell editing and sets its width to 98%, trying to prevent it from sticking out of the cell. Now I can&#39;t find that my post in the forum, and I see my fix did not make 3.5, so I wonder, would you consider it for 3.6? I mean, setting an input width to 98% does not really fix the problem. Depending on the padding/borders set by CSS, the input might still stick out of the cell, as it was in my case...</p>
<p>So, the solution is:</p>
<p>1) wrap input in the &#60;div class="twrap"&#62;;</p>
<p>2) the CSS is:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit2231' value='Select Code' data-codeid='sfcode2231' /></p>
<div class='sfcode' id='sfcode2231'>.scroll .twrap { padding:1px 2px; background-color:#FFF; /* optional border here */ }<br />.scroll .twrap input, .FormGrid .twrap input { border:0 none; padding:0; width:100%; }</div>
<p>so borders (imho not necessary if the selected row background is dark enough but always possible) and padding are moved to the wrapper;</p>
<p>3) the following adjustments in the code are necessary to support the wrapper:</p>
<p>in <strong>grid.celledit.js<br /></strong></p>
<p><input type='button' class='sfcodeselect' name='sfselectit293' value='Select Code' data-codeid='sfcode293' /></p>
<div class='sfcode' id='sfcode293'>window.setTimeout(function () { $(elc).focus(); },0);</div>
<p style="padding-left: 30px;">becomes</p>
<p><input type='button' class='sfcodeselect' name='sfselectit6404' value='Select Code' data-codeid='sfcode6404' /></p>
<div class='sfcode' id='sfcode6404'>window.setTimeout(function () { $(elc).focus(); $(&#39;input&#39;,elc).focus(); },0);</div>
<p>in <strong>grid.common.js</strong></p>
<p><input type='button' class='sfcodeselect' name='sfselectit4152' value='Select Code' data-codeid='sfcode4152' /></p>
<div class='sfcode' id='sfcode4152'>jQuery(elem).css({width:"98%"});</div>
<p style="padding-left: 30px;">becomes  (2 occurences)</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3367' value='Select Code' data-codeid='sfcode3367' /></p>
<div class='sfcode' id='sfcode3367'>elem =&#160; $(&#39;&#60;div class="twrap"&#62;&#60;/div&#62;&#39;).append(elem).get(0);</div>
<p>in <strong>grid.formedit.js</strong></p>
<p><input type='button' class='sfcodeselect' name='sfselectit2691' value='Select Code' data-codeid='sfcode2691' /></p>
<div class='sfcode' id='sfcode2691'>$(elc).addClass("FormElement");</div>
<p style="padding-left: 30px;">becomes</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1129' value='Select Code' data-codeid='sfcode1129' /></p>
<div class='sfcode' id='sfcode1129'>if (elc.tagName==&#39;DIV&#39;) $(elc).children().addClass("FormElement"); else $(elc).addClass("FormElement");</div>
<p>in <strong>grid.inlinedit.js</strong></p>
<p><input type='button' class='sfcodeselect' name='sfselectit1683' value='Select Code' data-codeid='sfcode1683' /></p>
<div class='sfcode' id='sfcode1683'>$(elc).addClass("editable");</div>
<p style="padding-left: 30px;">becomes</p>
<p><input type='button' class='sfcodeselect' name='sfselectit6849' value='Select Code' data-codeid='sfcode6849' /></p>
<div class='sfcode' id='sfcode6849'>if (elc.tagName==&#39;DIV&#39;) $(elc).children().addClass("editable"); else $(elc).addClass("editable");</div>
<p>Voila. Works in all browsers. I employ it in a big project, so far so good. Hope you find it useful.</p>
<p>cheers,<br />snobo</p>
]]></description>
        	        	<pubDate>Thu, 05 Nov 2009 09:03:41 +0200</pubDate>
        </item>
</channel>
</rss>