Hi
Is it possible to get all the leafs nodes from selected task .
Support Forum
Please open https://bryntum.com/examples/scheduler/tree/ demo, select a resource (Terminal A for example), and run in console:
Check the `result`
Docs here:
https://www.bryntum.com/docs/scheduler/#Common/data/mixin/TreeNode#property-isLeaf
https://www.bryntum.com/docs/scheduler/#Common/data/mixin/TreeNode#function-traverse
result = []; scheduler.selectedRecord && scheduler.selectedRecord.traverse(node => node.isLeaf && result.push(node));
result.map(node => node.name)
// ["Gate 1", "Gate 2", "Gate 3", "Gate 4", "Gate 5", "Gate 6", "Gate 7", "Gate 8", "Gate 9", "Gate 10"]
https://www.bryntum.com/docs/scheduler/#Common/data/mixin/TreeNode#property-isLeaf
https://www.bryntum.com/docs/scheduler/#Common/data/mixin/TreeNode#function-traverse
Pavlo Miklashevych
Sr. Frontend Developer
Please select Gate 1 and run in console:
parent = scheduler.selectedRecord && scheduler.selectedRecord.parent;
result = [];
root = scheduler.resourceStore.rootNode;
while (parent) {
result.push(parent);
parent = parent.parent;
}
result.map(node => node === root ? 'root' : node.name)
//["Gates 1 - 5", "Terminal A", "Kastrup Airport", "root"]
Pavlo Miklashevych
Sr. Frontend Developer