Maximize productivity with
30% off* for a limited time
using BOOSTDEV30.
Includes 3- and 5-packs.
*Some exclusions may apply.New Product LaunchBoldDesk: Help desk ticketing software starts at $10 for 3 agents.
Try it for free.
onExpand(args) {
let parentId = args.nodeData["id"];
// checks whether the expand action happens for the first time
if (this.expandedNode.indexOf(parentId) === -1) {
this.expandedNode.push(parentId);
let liEle = args.node.querySelectorAll('ul li');
for (let i = 0; i < liEle.length; i++) {
var id = liEle[i].getAttribute("data-uid");
// checks whether the child nodes of the expanded node is in checkedNode
if (this.checkedNodes.indexOf(id) !== -1) {
this.treeObj.checkAll([liEle[i]]);
}
}
} else {
// Cancel the event if the node is already expanded and checked
args.cancel = true;
}
} |