Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
input width 100% with no issues when doing inline editing
06/05/2009
08:07
Avatar
snobo
Member
Members
Forum Posts: 34
Member Since:
05/03/2009
sp_UserOfflineSmall Offline

Hi Tony,

I have a more or less simple suggestion how to achive real 100% input width when doing inline/cell editing. Currently, you set input width to 98%, as a dirty/partial workaround for a input width issue (when set to 100% it stretches out of cell boundaries). I say partial, because depending on user's CSS inputs may still pierce out of the cell or simply look unaligned.

So, I suggest to wrap text input in a div, and move input's borders, padding and background to this parent div (all issues disappear). I've made the following modifications:

grid.common.js

jQuery(elem).css({width:"98%"});

changes into

elem =  $('<div class="twrap"></div>').append(elem).get(0);

 grid.inlinedit.js

$(elc).addClass("editable")

changes into

if (elc.tagName=='DIV') $(elc).children().addClass("editable"); else $(elc).addClass("editable");

and in the CSS I've added the following (for example):

.grid_bdiv .twrap { padding:2px; background-color:#FFF; }
.grid_bdiv .twrap input { border:0 none; padding:0; width:100%; }

Voila! Tested in FF3, IE6/7, everything works... In grid.celledit.js a small fix is also necessary for

window.setTimeout(function () { $(elc).focus();},0);

for example,

window.setTimeout(function () { $(':input',cc).focus();},0);

dunno about other places, I guess you can know better.

Generally, 100% width of an input inside %-width table cell can be a really pain-in-the-ass problem in IE6/7, which I learnt how to cure via usage of multiple wrappers and positioning, but here in the jqGrid it's not a big deal because of the fixed column widths.

my 0.02 euro 😉

09/05/2009
10:48
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Yes I learned this before some days too Smile

Will perform some tests and maybe include this. The problem that appear here is in form edit when we have relative smal items in select,  but the table data is relative big. In this case the look is not so impressive

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

03/06/2009
05:19
Avatar
snobo
Member
Members
Forum Posts: 34
Member Since:
05/03/2009
sp_UserOfflineSmall Offline

Don't really get what you mean, but anyway I only suggested to fix the inline/cell editing.

Just found one more place that would need fixing should you consider it possible to include, in grid.celledit.js, line #89, for example like this:

window.setTimeout(function () { $(elc).focus(); $('input',elc).focus(); },0);

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
56 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information