mirror of https://github.com/layui/layui
table 处理LAY_DISABLED在一些特殊的情境比如当前页所有记录都不可操作的时候全选框的状态(disabled和checked)
parent
58f7c19ca5
commit
1f5781e55f
|
@ -997,7 +997,14 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||||
|
|
||||||
that.renderForm();
|
that.renderForm();
|
||||||
typeof thisCheckedRowIndex === 'number' && that.setThisRowChecked(thisCheckedRowIndex);
|
typeof thisCheckedRowIndex === 'number' && that.setThisRowChecked(thisCheckedRowIndex);
|
||||||
|
if (that.layBody.find('input[name="layTableCheckbox"]:not(:disabled)').length) {
|
||||||
|
// 当前有可操作的单项复选框才需要同步状态
|
||||||
that.syncCheckAll();
|
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(){
|
that.haveInit ? that.scrollPatch() : setTimeout(function(){
|
||||||
|
|
Loading…
Reference in New Issue