Table tree support selectAll func
This commit is contained in:
parent
ec1f67fa7e
commit
3c9452ef2a
2 changed files with 35 additions and 12 deletions
|
@ -851,11 +851,13 @@
|
|||
// }
|
||||
|
||||
// });
|
||||
for(const data of this.rebuildData){
|
||||
if(this.objData[data._index]._isDisabled){
|
||||
continue;
|
||||
}else{
|
||||
this.objData[data._index]._isChecked = status;
|
||||
for (const data of this.rebuildData) {
|
||||
const objData = this.objData[data._index];
|
||||
if (!objData._isDisabled) {
|
||||
objData._isChecked = status;
|
||||
}
|
||||
if (data.children && data.children.length) {
|
||||
this.selectAllChildren(objData, status);
|
||||
}
|
||||
}
|
||||
const selection = this.getSelection();
|
||||
|
@ -866,7 +868,18 @@
|
|||
}
|
||||
this.$emit('on-selection-change', selection);
|
||||
},
|
||||
|
||||
selectAllChildren (data, status) {
|
||||
if (data.children && data.children.length) {
|
||||
data.children.map(item => {
|
||||
if (!item._isDisabled) {
|
||||
item._isChecked = status;
|
||||
}
|
||||
if (item.children && item.children.length) {
|
||||
this.selectAllChildren(item, status);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
fixedHeader () {
|
||||
if (this.height || this.maxHeight) {
|
||||
this.$nextTick(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue