In jqgrid inline editing is stared by double clicking in a cell. Cursor is positioned to first editable column. Second click in required to place cursor to the cell which was clicked.
How to put cursor to the cell which was clicked to start inline edit? In cell edit mode clicked cell receives focus properly.
function beginInlineEdit(rowID, afterSave) {
var grid2 = $("#grid");
if (rowID && rowID !== lastSelectedRow) {
var scrollPosition = $("#grid").closest(".ui-jqgrid-bdiv").scrollLeft();
cancelEditing($("#grid"));
lastSelectedRow = rowID;
setTimeout(function () {
grid2.closest(".ui-jqgrid-bdiv").scrollLeft(scrollPosition);
}, 100);
}
$("tr#" + lastSelectedRow + " div.ui-inline-edit, " + "tr#" + lastSelectedRow + " div.ui-inline-del").hide();
$("tr#" + lastSelectedRow + " div.ui-inline-save, " + "tr#" + lastSelectedRow + " div.ui-inline-cancel").show();
$("#grid").jqGrid('editRow', lastSelectedRow, true, null, null, null,
{ _dokdata: FormData },
afterSave,
errorfunc,
function () {
cancelEditing($("#grid"));
setFocusToGrid();
}
);
}
Update 1
I tried Oleg demo in IE9. Issues:
double-clicking in checkbox column still puts focus to first column.
I decreased browse window width and scrolled right. Clicking in righmost column causes strange rapid flashing: grid scrolls to leftmost position and after that back to right position.
How to fix those issues ?