Hi Nithin,
Thanks for contacting Syncfusion Support.
Query#:- I need to get the selected row details from the treegrid. I have button, when clicking on the button I need to capture the row data.
We have checked your query and if you want to get the selected row details you can use getSelectedRecords method of the TreeGrid pn external button click.
Refer to the code example:-
<button ej-button class='e-flat' (click)='add()'> selectedrecords </button>
<ejs-treegrid [dataSource]='sampleData' [treeColumnIndex]='1' childMapping='subtasks' [selectionSettings]='selectionSettings'>
<e-columns >
<e-column field='taskID' headerText='Task ID' textAlign='Right' width=70>
</e-column>
. . .
</e-columns>
</ejs-treegrid>
add(): void {
var tree = document.getElementsByClassName('e-treegrid')[0].ej2_instances[0];
var records = tree.getSelectedRecords();
alert(records)
} |
Please get back to us if you need any further assistance.
Regards,
Farveen sulthana T