We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Get selected rows details on a button click

Thread ID:

Created:

Updated:

Platform:

Replies:

149034 Nov 12,2019 12:33 PM UTC Nov 13,2019 12:04 PM UTC Angular - EJ 2 1
loading
Tags: TreeGrid
Nithin Benny
Asked On November 12, 2019 12:33 PM UTC

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.


Farveen Sulthana Thameeztheen Basha [Syncfusion]
Replied On November 13, 2019 12:04 PM UTC

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 


CONFIRMATION

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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon