JSFiddle - React, Tailwind, and code Playground
JavaScript
$.jgrid.extend({
nextCell : function (iRow, iCol)
{
return this.each(function ()
{
var $t = this, nCol = false;
if (!$t.grid || $t.p.cellEdit !== true) {return;}
// trying to find next editable column on the right from actual selected cell
for (var i = iCol + 1; i < $t.p.colModel.length; i++)
{
if ( $t.p.colModel[i].editable === true )
{
nCol = i;
break;
}
}
// if such one doesn't exist, trying to find next editable column on the left
if(nCol === false)
{
for (var i = 0; i < (iCol -1); i++)
{
if ( $t.p.colModel[i].editable === true )
{
nCol = i;
break;
}
}
}
if(nCol !== false)
{
if (nCol > iCol) // if it is in the same row
$($t).jqGrid("editCell", iRow, nCol, true);
else //edit in the nex row
$($t).jqGrid("editCell", (iRow + 1) , nCol, true);
}
else
{
if ($t.p.savedRow.length > 0)
$($t).jqGrid("saveCell", iRow, iCol);
}
});
},
prevCell : function (iRow, iCol)
{
return this.each(function ()
{
var $t = this, nCol = false;
if (!$t.grid || $t.p.cellEdit !== true) {return;}
// trying to find next editable column on the left from actual selected cell
for (var i= iCol-1; i >= 0; i--)
{
if ( $t.p.colModel[i].editable === true)
{
nCol = i;
break;
}
}
...