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

i want button on child gird toolbar and on-click on this button i want selected row data into function

Thread ID:

Created:

Updated:

Platform:

Replies:

146526 Aug 7,2019 07:00 AM UTC Aug 8,2019 12:29 PM UTC Angular - EJ 2 1
loading
Tags: Grid
Anup
Asked On August 7, 2019 07:02 AM UTC

Hi Team,

I am using @syncfusion/ej2-angular-grids' component and i am stuck in child grid operation
i want two button on toolbar or row on-click event on this button component.ts  function should execute with selected row data.

Please help me on above issue pls give me example link if available.

Balaji Sekar [Syncfusion]
Replied On August 8, 2019 12:29 PM UTC

Hi Anup, 

Thanks for your patience, 

We have created a sample with your requirement and you can bind the custom button on toolbar using following code snippet. We have already discussed about the custom items rendering on toolbar in our Help Documentation and we have find the Grid selected records details in toolbarClick event of EJ2 Grid. Please refer the below code example, sample and Help Documentation. 

[app.component.ts] 

this.childGrid = { 
        dataSource: orderDatas, 
        queryString: 'EmployeeID', 
        allowPaging: true, 
        toolbar: [{ text: 'Click', tooltipText: 'Click', prefixIcon: 'e-expand', id: 'Click' }], // we have bind the custom button on toolbar 
        toolbarClick: function (args) { 
            if (args.item.id === 'Click') { 
                var selectedRecord = this.getSelectedRecords(); // we have get the selected records details 
                console.log(selectedRecord); 
            } 
        }, 
        pageSettings: { pageSize: 6, pageCount: 5 }, 




Regards, 
Balaji Sekar. 


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