mirror of https://github.com/ElemeFE/element
Table: update selection isAllSelected (#9634)
parent
b68f18aa94
commit
896cbb6323
|
@ -502,23 +502,14 @@ TableStore.prototype.updateAllSelected = function() {
|
|||
let selectedCount = 0;
|
||||
for (let i = 0, j = data.length; i < j; i++) {
|
||||
const item = data[i];
|
||||
if (selectable) {
|
||||
const isRowSelectable = selectable.call(null, item, i);
|
||||
if (isRowSelectable) {
|
||||
if (!isSelected(item)) {
|
||||
isAllSelected = false;
|
||||
break;
|
||||
} else {
|
||||
selectedCount++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!isSelected(item)) {
|
||||
const isRowSelectable = selectable && selectable.call(null, item, i);
|
||||
if (!isSelected(item)) {
|
||||
if (!selectable || isRowSelectable) {
|
||||
isAllSelected = false;
|
||||
break;
|
||||
} else {
|
||||
selectedCount++;
|
||||
}
|
||||
} else {
|
||||
selectedCount++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue