Currently in jqGrid, I have disabled row selection using the following code:
beforeSelectRow: function() {
return false;
}
This setup works perfectly for left clicking. However, I've noticed that the beforeSelectRow
event handler isn't being triggered when right-clicking, and the row is still selected. This poses an issue for me as I'm creating a custom context menu.
To address this, I found a workaround which some may consider a hack, outlined in this answer on Stack Overflow: Is it possible to Stop jqGrid row(s) from being selected and/or highlighted?
I'm curious if there's a more elegant solution to achieve the same result without resorting to hacks?
Thank you!
Update
It seems that this issue only arises with subgrids. A demonstration can be seen in this example. If you test it out, you'll observe that left clicking does not select the row, but right clicking does.
(I must admit, I took the easy road and borrowed this example from another question answered by Oleg.)