In my jqgrid, I have a cell that has link in it.Currently when the user clicks this link the row is selected (I am using multiselect) I don't want this, Is there a way to not select the row when the user click in this particular cell with the link? I have thought about doing a onCellSelect and then seeing if the current cell is selected and setting it back to the way it was before the cell was clicked. Not sure if this is the best way, or it is even possible. I can't find a way to check if the current row is selected, nor can I find a way to change if a row is selected or not. Any ideas would help. Thanks!
Asked
Active
Viewed 1.1k times
1 Answers
15
If I understand you correct you can use beforeSelectRow event handler with the following code for example:
beforeSelectRow: function(rowid, e) {
var $link = $('a', e.target);
if (e.target.tagName.toUpperCase() === "A" || $link.length > 0) {
// link exist in the item which is clicked
return false;
}
return true;
}
returning of the false
value from the beforeSelectRow
will prevent selection of the row.

Oleg
- 220,925
- 34
- 403
- 798
-
Oleg, Once again you have clearly helped me. I marvel at your skills and knowledge. And I thank you greatly!...it worked perfectly BTW! :) – twaldron May 11 '11 at 20:26
-
I have the issue when I try to subscribe on this event using by the `on` method. I get an incorrect event target. What can it be? Thanks! – Igor Timoshenko Apr 05 '13 at 10:13
-
@IgorTimoshenko: It's better that you describe your problem in details in new question. I don't understand why you would need to use `on`. – Oleg Apr 05 '13 at 10:20
-
@Oleg, I use jqGrid with Backbone.js View and I have own method on the event `beforeSelectRow` so I described on the related event `jqGridBeforeSelectRow` on jqGrid. – Igor Timoshenko Apr 05 '13 at 11:13
-
@IgorTimoshenko: Sorry, I don't understand what you mean under "own method on event `beforeSelectRow`". Moreover I don't use `Backbone.js` myself. Could you describe your problem **in details** in new question. – Oleg Apr 05 '13 at 11:16