使用JQGrid,我知道选择一行时的onSelectRow事件。
我想知道当您因为选择了另一行而取消选择一行时是否会发生事件。
谢谢
最佳答案
您仍然可以创建自定义事件:
onSelectRow: function (id) {
if (this.lastSel && id && id !== this.lastSel) {
$(this).trigger('deselectRow', [this, this.lastSel]);
}
this.lastSel = id;
}
然后绑定(bind)事件:
$("#grid").on('deselectRow', function(e, table, rowId){
console.log(rowId); // $('#'+rowId, table);
});
-DEMO-
关于jquery - JQGrid : deselect event,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26631903/