Forum
18:18
07/06/2009
With inline edit mode as the user tabs through the input elements, the current value of the element is selected. With cell editing mode the current value is not selected. This can be painful for users editing the data in a grid as they have to manually select the text to replace the value. It would be nice if the text was automatically selected when the user selects the cell to edit.
This seemed like it should be as easy as changing the following line in editCell function grid.celledit.js
function () { $(elc).focus();},0);
window.setTimeout(
change to:
window.setTimeout(function () { $(elc).focus();$(elc).select();},0);
However, it actually took quite a bit more changes to make the focus stay on the element at the right times. And for some reason IE seemed to need a delay built into the setTimeout call to make this work in all scenarios. If you would like the code, I can post it, but I am sure it can probably be done better.
Thanks for considering the change!
13:47
10/02/2010
I was just thinking of a way to archieve this when I came across your topic. Obviously I would be intrested in more of your changes to the code, and maybe some others as well.
However, I'd like to see this as an future option in jqGrid. The exact same argument on why the OP wanted to archieve this can be applied to my company.
16:59
19/10/2009
If I read you correctly, you should be able to achieve the desired effect without needing to alter jqgrid's code by adding an afterEditCell event handler.
$("#" + this.id + " tbody>tr:eq(" + iRow + ")>td:eq(" + iCol + ") input, select, textarea").select();
}
On the other hand, one might want to have a more excel-like behaviour (we're talking of data grids after all) and place the caret depending on where the user clicked.
Therefore, I'm not really confident selecting the content of a cell after it starts being edited is the most "standard" or most ergonomic behavior from a user perspective. It probably depends of what kind of data is being edited and how the user wants to edit it (e.g. not placeing the caret where the user clicked would be painful to the user if all he wants is to correct a spelling mistake on the 12th character of a 20 characters string).
But we probably both agree the current behavior (just enter "edit" mode) is the least ergonomic.
Still, as it is a common denominator, it seems quite appropriate.
17:04
Moderators
30/10/2007
Hello ben,
Thanks. As you said we should provide mechanisms and not ready solutions. Let say that after some time another user want that they want not to select a value
Best 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.
Most Users Ever Online: 715
Currently Online:
54 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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66