Table: update selection isAllSelected (#9634)

pull/9620/merge
杨奕 2018-02-03 16:08:13 +08:00 committed by GitHub
parent b68f18aa94
commit 896cbb6323
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 14 deletions

View File

@ -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++;
}
}