I am trying select (i.e. highlight and check the checkbox) only on double click of a row, not on single click. But not getting getting a clue how to achieve this.
Can anyone please help me on this.
The solution consist from 3 steps:
To prevent default selection one need include the following callback
beforeSelectRow: function () {
return false; // prevent selection
}
To select on double-click one should call setSelection
inside of ondblClickRow
callback
ondblClickRow: function (rowid) {
$(this).jqGrid("setSelection", rowid);
}
To prevent selection of the text in the cell on double-click one need to add CSS rule like the following:
.ui-jqgrid tr.jqgrow > td {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}