Category / Section
How to refresh the data in EJ2 TreeView?
1 min read
In our TreeView component, the fields property has been provided to set or get the data source and other data related information. You can use this property to dynamically change the TreeView component data source. The following code demonstrates how to update data source for TreeView.
Typescript
let treeInstance: TreeView = getComponent(document.querySelector('#tree'),'treeview');
treeInstance.fields = { dataSource: hierarchicalData, id: 'id', text: 'name', child:'subChild' };
Sample: https://stackblitz.com/edit/nzip6j-bvsvsv?file=index.ts
Javascript:
var treeInstance = ej.base.getComponent(document.querySelector('#tree'),'treeview');
treeInstance.fields = { dataSource: hierarchicalData, id: 'id', text: 'name', child:'subChild' };
Did not find the solution
Contact Support