javascript - How to expand all nodes that has a children on page load by default in wix angular tree control -
has tried expand nodes has children on page load default in tree created angular tree control. packed lots of features lacks one. having expanded nodes property. need find array of nodes has children other logic , has pass same expanded nodes? correct logic or missing inbuilt functionality in directive? please help
in order load nodes expanded, have create list of node objects should expanded default , pass expanded-nodes attribute in html
controller script as:
$scope.dataforthetree = [{ text: "data sources", children: [{ text: "hard drive health", children: [] }] }, { text: "diagrams", children: [{ text: "hard drive failure example", children: [] }] }]; $scope.expandednodes = [vm.dataforthetree[0],vm.dataforthetree[1]];
html element as:
<treecontrol class="tree-classic" tree-model="dataforthetree" expanded-nodes="expandednodes"> {{node.text}} </treecontrol>
Comments
Post a Comment