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!
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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.