Forum
Topic RSS
03:58
05/01/2012
OfflineI've been rummaging arround on the net for a while trying to find an answer for this, and i've found a few hints in the right direction but i'm having trouble getting it to work
What i'd like to do, is when you tab away from the last editable cell it moves you to the next row and then activates one specific cell ('Description', 7th column)
var key = e.charCode || e.keyCode; // to support all browsers
if(key == 9) { // tab
if (lastSel) {
var ind = grid.jqGrid('getInd', lastSel, false);
var dataIDs = grid.jqGrid('getDataIDs');
if (ind < dataIDs.length) {
var nextRowID = dataIDs[ind];
grid.jqGrid('setSelection', nextRowID, true); // trigger onSelectRow
//You are at the end of the row, but not the last row. Go to next row
//$('textarea[name="description"]', ind).focus();
grid.editCell( nextRowID, 7, false);
} else {
addRow();
var nextRowID = dataIDs[ind];
grid.editCell( nextRowID, 7, false);
//You are at the end of the last row. Create new row... Selects it automatically?
}
}
return false;
Right now it's going to the next line, but not doing much with the 'editCell'... am i calling it the wrong way perhaps? i changed it once already when i was getting errors
Most Users Ever Online: 994
Currently Online:
24 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
Log In
Home