<?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='sfselectit5270' value='Select Code' data-codeid='sfcode5270' /></p>
<div class='sfcode' id='sfcode5270'>.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='sfselectit8655' value='Select Code' data-codeid='sfcode8655' /></p>
<div class='sfcode' id='sfcode8655'>window.setTimeout(function () { $(elc).focus(); },0);</div>
<p style="padding-left: 30px;">becomes</p>
<p><input type='button' class='sfcodeselect' name='sfselectit2649' value='Select Code' data-codeid='sfcode2649' /></p>
<div class='sfcode' id='sfcode2649'>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='sfselectit3271' value='Select Code' data-codeid='sfcode3271' /></p>
<div class='sfcode' id='sfcode3271'>jQuery(elem).css({width:"98%"});</div>
<p style="padding-left: 30px;">becomes  (2 occurences)</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9292' value='Select Code' data-codeid='sfcode9292' /></p>
<div class='sfcode' id='sfcode9292'>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='sfselectit2864' value='Select Code' data-codeid='sfcode2864' /></p>
<div class='sfcode' id='sfcode2864'>$(elc).addClass("FormElement");</div>
<p style="padding-left: 30px;">becomes</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1880' value='Select Code' data-codeid='sfcode1880' /></p>
<div class='sfcode' id='sfcode1880'>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='sfselectit2574' value='Select Code' data-codeid='sfcode2574' /></p>
<div class='sfcode' id='sfcode2574'>$(elc).addClass("editable");</div>
<p style="padding-left: 30px;">becomes</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1428' value='Select Code' data-codeid='sfcode1428' /></p>
<div class='sfcode' id='sfcode1428'>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>