table 处理LAY_DISABLED在一些特殊的情境比如当前页所有记录都不可操作的时候全选框的状态(disabled和checked)
This commit is contained in:
parent
58f7c19ca5
commit
1f5781e55f
@ -997,7 +997,14 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
|
||||
that.renderForm();
|
||||
typeof thisCheckedRowIndex === 'number' && that.setThisRowChecked(thisCheckedRowIndex);
|
||||
that.syncCheckAll();
|
||||
if (that.layBody.find('input[name="layTableCheckbox"]:not(:disabled)').length) {
|
||||
// 当前有可操作的单项复选框才需要同步状态
|
||||
that.syncCheckAll();
|
||||
} else {
|
||||
// 没有任何可操作的时候禁止全选框操作并且设置其选中状态 此时不宜用table.checkStatus获取是否全选状态
|
||||
form.render(that.layHeader.find('input[name="layTableCheckbox"]').prop('disabled', true)
|
||||
.prop('checked', !that.layBody.find('input[name="layTableCheckbox"]:not(:checked)').length));
|
||||
}
|
||||
|
||||
//滚动条补丁
|
||||
that.haveInit ? that.scrollPatch() : setTimeout(function(){
|
||||
|
Loading…
Reference in New Issue
Block a user