如何在点击时取消选择一行?我试过这个:
beforeSelectRow: function(rowid, e) {
if ($(this).getGridParam('selrow') == rowid) {
return false;
} else {
return true;
}
}
Run Code Online (Sandbox Code Playgroud)
但只有选择有效,如果我点击选定的行,它什么都不做.
Fas*_*ack 13
而不是return false尝试:
$("#myGrid").jqGrid("resetSelection");
Run Code Online (Sandbox Code Playgroud)
所以你的代码是:
beforeSelectRow: function (rowid) {
if ($(this).jqGrid("getGridParam", "selrow") === rowid) {
$(this).jqGrid("resetSelection");
} else {
return true;
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12565 次 |
| 最近记录: |