新增表格行触发事件(onCheck、onUncheck、onCheckAll、onUncheckAll)

This commit is contained in:
RuoYi
2020-11-12 10:30:15 +08:00
parent c27ea9d3f4
commit cefb14e521
2 changed files with 30 additions and 0 deletions

View File

@ -24,6 +24,10 @@
showRefresh: false,
showToggle: false,
showColumns: false,
onCheck: onCheck,
onUncheck: onUncheck,
onCheckAll: onCheckAll,
onUncheckAll: onUncheckAll,
onClickRow: onClickRow,
onDblClickRow: onDblClickRow,
onClickCell: onClickCell,
@ -95,6 +99,28 @@
alert("双击格name" + field + " value" + value);
}
function onCheck(row, $element){
alert("选中行userId" + row.userId + " userName" + row.userName);
}
function onUncheck(row, $element){
alert("取消行userId" + row.userId + " userName" + row.userName);
}
function onCheckAll(rowsAfter, rowsBefore){
var rows = $.map(rowsAfter, function(row) {
return $.common.getItemField(row, "userId");
});
alert("全选行:" + rows);
}
function onUncheckAll(rowsAfter, rowsBefore){
var rows = $.map(rowsBefore, function(row) {
return $.common.getItemField(row, "userId");
});
alert("取消行:" + rows);
}
function responseHandler(res){
alert("请求获取数据后处理回调函数");
}