Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
142295 | Jan 25,2019 12:14 PM UTC | Feb 4,2019 11:27 AM UTC | Angular - EJ 2 | 9 |
![]() |
Tags: Treeview |
<button ejs-button (click)="expandAll()">Expand All nodes</button>
<button ejs-button (click)="collapseAll()">Collapse All nodes</button>
public expandAll()
{
this.treeObj.expandAll();
}
public collapseAll()
{
this.treeObj.collapseAll();
} |
|
<ejs-treeview #default id="default" fields='field'></ejs-treeview>
Here, #default is the template reference used to access TreeView component using ViewChild |
import { ViewChild }
from '@angular/core';
@ViewChild('default') // 'default' is the Template reference defined for TreeView in html page public treeObj: TreeViewComponent; //Now you can access tree instance like below, ngOnInit() { this.treeObj.expandedNodes = ['03']; }
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.