table 修复LAY_DISABLED功能的一些异常问题

This commit is contained in:
sunxiaobin89 2022-06-27 06:15:29 +08:00
parent 4b7f74b97b
commit 58f7c19ca5
2 changed files with 9 additions and 7 deletions

View File

@ -29,7 +29,8 @@
,"checkin": "106"
,"joinTime": "2016-10-14"
,"LAY_CHECKED": true
}, {
,"LAY_DISABLED": true
}, {
"id": "10003"
,"username": "苏轼"
,"email": "test3@email.com"

View File

@ -1724,8 +1724,10 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
//全选
if(isAll){
childs.each(function(i, item){
item.checked = checked;
that.setCheckData(i, checked);
if (!item.disabled) {
item.checked = checked;
that.setCheckData(i, checked);
}
});
that.syncCheckAll();
that.renderForm('checkbox');
@ -2113,14 +2115,13 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
//计算全选个数
layui.each(data, function(i, item){
if(layui.type(item) === 'array'){
if(layui.type(item) === 'array' || item[table.config.disabledName]){ // 不可操作的节点对于统计来说也属于无效
invalidNum++; //无效数据,或已删除的
return;
}
if(item[table.config.checkName]){
nums++;
arr.push(table.clearCacheKey(item));
if(!item[table.config.disabledName]){
arr.push(table.clearCacheKey(item));
nums++;
}
}
});