Fixed an issue where destroy method is not present for the browser tree after React porting.

This commit is contained in:
Pradip Parkale 2022-01-03 17:47:22 +05:30 committed by Akshay Joshi
parent a4ef5ea48b
commit c1ad7d81f4

View File

@ -92,6 +92,15 @@ export class Tree {
return await this.tree.create(item, data);
}
async destroy() {
const model = this.tree.getModel();
this.rootNode.children = [];
if (model.root) {
model.root.isExpanded = false;
await model.root.hardReloadChildren();
}
}
next(item) {
if(item) {
let parent = this.parent(item);