public countries: Object[] = [
{ id: 1, name: 'Australia', hasChild: true, expanded: true },
{ id: 2, pid: 1, name: 'New South Wales', isSelected: true }
];
public field: Object = { dataSource: this.countries, id: 'id', parentID: 'pid', text: 'name', hasChildren: 'hasChild', selected: 'isSelected' }; |
this.tree.selectedNodes = ['1']; |
selectNode(){
var treeInstance = this.tree;
setTimeout(() => {
this.data = this.countries;
//If you are unable to access the TreeView instance
treeInstance.selectedNodes = [this.data[4].id];
}, 1000);
} |