Open bharath3719 opened 4 years ago
You can do that if you get your dropdown-treeview as ViewChild. Like this:
@ViewChild(DropdownTreeviewComponent , {static: false}) treeView: DropdownTreeviewComponent ;
Then you can access selected items as this.treeView.selection.checkedItems
Can confirm this also works for TreeviewComponent:
@ViewChild(TreeviewComponent) treeView: TreeviewComponent
Then you can access the treeview object by adding a (selectedChange)="nodeSelected($event)"
const selectedIds = this.treeView.selection.checkedItems.map(s => s.value); // mapping to a single value is optional
Hi i have this code for component
<ngx-dropdown-treeview [config]="config" [items]="items" (filterChange)="onFilterChange($event)" (selectedChange)="onSelectionChange($event)" [buttonClass]="buttonClass"
and in ts .
}
I am getting only the selected value , how can i get the selected text ?