JqGrid单选

时间:2021-07-30 09:03:49

You have to do some more stuff:

1. Set multiboxonly to true and multiselect to true

2. Define the events onSelectRow and beforeSelectRow:

3. Define global variable: var lastSel;


The OnSelectRow and beforeSelectRow implementation:

onSelectRow: function (rowId, status, e) {
var lastSel;
if (rowId == lastSel) {
$(this).jqGrid("resetSelection");
lastSel = undefined;
status = false;
} else {
lastSel = rowId;
}
},
beforeSelectRow: function (rowId, e) {
$(this).jqGrid("resetSelection");
return true;
}

转自:http://*.com/questions/6756131/jqgrid-single-select-checkbox