Forum



00:03

29/08/2011

I am using datatype:"local" with cell editing and trying to modify nextCell to move to the next row if tabbing out of the last column of the previous row. The code (below) is close, however, it leaves the previous row highlighted. I have tried setSelection and resetSelection to remove the highlighting with no luck. I have also tried removeClass("ui-state-highlight").attr("aria-selected","false"); with no luck. Any ideas? Also, is there a way to override nextCell as opposed to modifying jqGrid's source code? I realize the user can move the cursor to the next row and hit the enter key to accomlish the same thing. Unfortunately, our customer does not like this default behaviour.
nextCell : function (iRow,iCol) {
return this.each(function (){
var $t = this, nCol=false;
if (!$t.grid || $t.p.cellEdit !== true) {return;}
// try to find next editable cell
var done = false;
var rowsInGrid = $($t).jqGrid("getDataIDs");
for (var r=iRow; r<=iRow+1; r++)
{
if ( r > rowsInGrid.length ) break;
if ( r != iRow )
{
$t.p.iRow = r;
iRow = r;
iCol = 0;
}
for (var i=iCol+1; i<$t.p.colModel.length; i++) {
if ( $t.p.colModel[i].editable ===true) {
nCol = i; done = true; break;
}
}
if ( done ) break;
}
if(nCol !== false) {
$($t).jqGrid("editCell",iRow,nCol,true);
} else {
if ($t.p.savedRow.length >0) {
$($t).jqGrid("saveCell",iRow,iCol);
}
}
});
},
Most Users Ever Online: 715
Currently Online:
31 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