I am trying to open a specific (mocked at the moment) node by using: this.tree.treeModel.getNodeById(64333);
but i can't make it work... i keep getting that "someNode" is undefined
this is my tree:
<tree-root #tree (focus)="focusNode($event)" (toggleExpanded)="onExpand($event)" (moveNode)="onMoveNode($event)" [nodes]="nodeList" [options]="options" class="tree-wrapper bold-node-text level1-document-icon-only m-b-20"> . . . . </tree-root>
Hello, I am following the angular-tree-component/guide more specifically where it explains how to expand nodes on init (https://circlongroup.github.io/angular-tree-component/guides/expanding)
I am trying to open a specific (mocked at the moment) node by using: this.tree.treeModel.getNodeById(64333); but i can't make it work... i keep getting that "someNode" is undefined
this is my tree:
<tree-root #tree (focus)="focusNode($event)" (toggleExpanded)="onExpand($event)" (moveNode)="onMoveNode($event)" [nodes]="nodeList" [options]="options" class="tree-wrapper bold-node-text level1-document-icon-only m-b-20"> . . . . </tree-root>
ts:
@ViewChild('tree') tree; ngAfterViewInit() { const someNode = this.tree.treeModel.getNodeById(64333); someNode.expand(); }