<?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='sfselectit2140' value='Select Code' data-codeid='sfcode2140' /></p>
<div class='sfcode' id='sfcode2140'>.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='sfselectit763' value='Select Code' data-codeid='sfcode763' /></p>
<div class='sfcode' id='sfcode763'>window.setTimeout(function () { $(elc).focus(); },0);</div>
<p style="padding-left: 30px;">becomes</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4074' value='Select Code' data-codeid='sfcode4074' /></p>
<div class='sfcode' id='sfcode4074'>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='sfselectit2318' value='Select Code' data-codeid='sfcode2318' /></p>
<div class='sfcode' id='sfcode2318'>jQuery(elem).css({width:"98%"});</div>
<p style="padding-left: 30px;">becomes  (2 occurences)</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9825' value='Select Code' data-codeid='sfcode9825' /></p>
<div class='sfcode' id='sfcode9825'>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='sfselectit8063' value='Select Code' data-codeid='sfcode8063' /></p>
<div class='sfcode' id='sfcode8063'>$(elc).addClass("FormElement");</div>
<p style="padding-left: 30px;">becomes</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3808' value='Select Code' data-codeid='sfcode3808' /></p>
<div class='sfcode' id='sfcode3808'>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='sfselectit1282' value='Select Code' data-codeid='sfcode1282' /></p>
<div class='sfcode' id='sfcode1282'>$(elc).addClass("editable");</div>
<p style="padding-left: 30px;">becomes</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7712' value='Select Code' data-codeid='sfcode7712' /></p>
<div class='sfcode' id='sfcode7712'>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>