Merge pull request #4151 from llnewuser/2.0
toggleSelectAll method should only operate on filtered data
This commit is contained in:
commit
8cc76ed915
1 changed files with 4 additions and 4 deletions
|
@ -83,10 +83,10 @@
|
|||
return (validKeysCount > 0 ? `${validKeysCount}/` : '') + `${this.data.length}`;
|
||||
},
|
||||
checkedAll () {
|
||||
return this.data.filter(data => !data.disabled).length === this.validKeysCount && this.validKeysCount !== 0;
|
||||
return this.filterData.filter(data => !data.disabled).length === this.validKeysCount && this.validKeysCount !== 0;
|
||||
},
|
||||
checkedAllDisabled () {
|
||||
return this.data.filter(data => !data.disabled).length <= 0;
|
||||
return this.filterData.filter(data => !data.disabled).length <= 0;
|
||||
},
|
||||
filterData () {
|
||||
return this.showItems.filter(item => this.filterMethod(item, this.query));
|
||||
|
@ -118,8 +118,8 @@
|
|||
},
|
||||
toggleSelectAll (status) {
|
||||
const keys = status ?
|
||||
this.data.filter(data => !data.disabled || this.checkedKeys.indexOf(data.key) > -1).map(data => data.key) :
|
||||
this.data.filter(data => data.disabled && this.checkedKeys.indexOf(data.key) > -1).map(data => data.key);
|
||||
this.filterData.filter(data => !data.disabled || this.checkedKeys.indexOf(data.key) > -1).map(data => data.key) :
|
||||
this.filterData.filter(data => data.disabled && this.checkedKeys.indexOf(data.key) > -1).map(data => data.key);
|
||||
this.$emit('on-checked-keys-change', keys);
|
||||
},
|
||||
handleQueryClear () {
|
||||
|
|
Loading…
Add table
Reference in a new issue