If I correctly understand your problem, the you should don't use the option cellEdit: true (but still use cellsubmit: 'remote') and to set cellEdit: true dynamically before calling cell editing methods (editCell, restoreCell, saveCell, prevCell or nextCell). Additionally you will have to duplicate the keyboard operations (see the lines of free jqGrid code). The resulting code could look like the code below:
ondblClickRow: function (rowid, iRow, iCol, e) {
var $self = $(this), p = $self.jqGrid("getGridParam");
p.cellEdit = true;
$self.jqGrid("editCell", iRow, iCol, true);
p.cellEdit = false;
},
afterEditCell: function (rowid, cmName, cellValue, iRow, iCol) {
var getTdByColumnIndex = function (tr, iCol) {
var $t = this, frozenRows = $t.grid.fbRows;
tr = frozenRows != null && frozenRows[0].cells.length > iCol ?
frozenRows[tr.rowIndex] : tr;
return tr != null && tr.cells != null ? $(tr.cells[iCol]) : $();
},
$td = getTdByColumnIndex.call(this, this.rows[iRow], iCol),
$self = $(this),
$t = this,
p = $self.jqGrid("getGridParam");
$("input, select, textarea", $td).on("keydown", function (e) {
if (e.keyCode === 27) { //ESC
p.cellEdit = true;
$self.jqGrid("restoreCell", iRow, iCol);
p.cellEdit = false;
} else if (e.keyCode === 13 && !e.shiftKey) { //Enter
p.cellEdit = true;
$self.jqGrid("saveCell", iRow, iCol);
p.cellEdit = false;
return false;
} else if (e.keyCode === 9) {
if (!$t.grid.hDiv.loading) {
p.cellEdit = true;
if (e.shiftKey) {
$self.jqGrid("prevCell", iRow, iCol); //Shift TAb
} else {
$self.jqGrid("nextCell", iRow, iCol); //Tab
}
p.cellEdit = false;
} else {
return false;
}
}
e.stopPropagation();
});
}
See https://jsfiddle.net/OlegKi/Lm7akxz2/