I have a jqgrid with multiselect enabled. But I don't want to check the checkbox when I click on the row.
Using the code snippet
$("#yourGrid").jqGrid("setGridParam", {
beforeSelectRow: function(rowId, e) {
return $(e.target).is("input:checkbox");
}
});
from this post I was able to refrain from selecting the checkbox but now I can't highlight a particular row. How can I enable highlighting of a row keeping multiselect on row click disabled.
There is a property on the grid that should do this for you, according to the API.
multiboxonly
This option works only when the multiselect option is set to true. When multiselect is set to true, clicking anywhere on a row selects that row; when multiboxonly is also set to true, the multiselection is done only when the checkbox is clicked (Yahoo style). Clicking in any other row (suppose the checkbox is not clicked) deselects all rows and selects the current row.
With this you shouldn't need your beforeSelectRow
function:
jQuery("#grid").jqGrid({
. . .
multiselect: true,
multiboxonly: true
. . .
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With