问题
I'm using multiselect: true
option on jqGrid setup.
The issue I'm having is when I click on any row, the checkbox get toggled. How do I limit the toggling of checkbox to "checkbox" column only when clicking on that "checkbox" column. I don't want the checkbox to be checked/unchecked when I click on 3rd column, 5th column, etc.
Is that possible?
回答1:
The callback beforeSelectRow
allows to define specific rules for selection the row. It should return false to prevent the selection. The checkboxes from multiselect column have CSS class "cbox"
. Thus the callback
beforeSelectRow: function (rowid, e) {
return $(e.target).hasClass("cbox");
}
should solve the problem.
来源:https://stackoverflow.com/questions/33402515/how-to-have-checkbox-be-toggled-on-checkbox-column-only-so-row-select-dont-t