问题
In JQgrid : To Edit a cell (not in first column), I need 3 mouse click to focus a cell, can I do that in double click ?
Eg : If I want to edit 'desription' column in my grid I need 3 mouse click.
回答1:
If you use free jqGrid, then you can use You can use focusField
option of editRow
:
ondblClickRow: function (rowid, iRow, iCol, e) {
$(this).jqGrid("editRow", rowid, { focusField: e.target });
},
beforeSelectRow: function (rowid) {
var $self = $(this), i,
// savedRows array is not empty if some row is in inline editing mode
savedRows = $self.jqGrid("getGridParam", "savedRow");
for (i = 0; i < savedRows.length; i++) {
if (savedRows[0].id !== rowid) {
// save currently editing row
// one can replace saveRow to restoreRow in the next line
$self.jqGrid("saveRow", savedRows[i].id);
}
}
return savedRows.length === 0; // allow selection if saving successful
},
See https://jsfiddle.net/ft7zsocy/
来源:https://stackoverflow.com/questions/40676214/jqgrid-triple-click-needed-to-edit-a-cell