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

Question: intercept on click action of the top-checkbox in the checkbox-column (Grid) ?

Thread ID:

Created:

Updated:

Platform:

Replies:

146973 Aug 27,2019 09:45 AM UTC Aug 28,2019 09:31 AM UTC Angular - EJ 2 3
loading
Tags: Grid
Viktor
Asked On August 27, 2019 09:45 AM UTC

Hi,
sorry if this question has been asked before.
is it possible to intercept on click action of the top checkbox in the checkbox-column?
or see picture below.
i am aware of the checkboxchange event (https://ej2.syncfusion.com/documentation/api/grid/#checkboxchange)
but it doesn't seem to be realy helpful since it triggers on all checkboxes in checkbox column.
thanks in advance
viktor


Manivel Sellamuthu [Syncfusion]
Replied On August 28, 2019 07:19 AM UTC

Hi Viktor, 

Thanks for contacting us. 

Yes. You can distinguish the header and row checkboxes based on the checkBoxChange event target. Please find the below code example and sample for more information. 

App.component.html 
   <ejs-grid #grid [dataSource]='data' allowPaging='true' [enableHover]="false"  (checkBoxChange)="checkBoxChange($event)" [allowSelection]="true" [selectionSettings]="selectOptions" [editSettings]='editSettings' [toolbar]='toolbar'> 
. . . 
    </ejs-grid> 
App.component.ts 
export class AppComponent { 
. . . 
    public checkBoxChange (args) { 
      if (args.target.classList.contains('e-checkselectall')) { 
        console.log ('Header checkBox is clicked'); 
      } 
      else { 
        console.log ('Row checkbox is cliked'); 
        // here you can get the row information for the checkBox clicked row 
        console.log(this.grid.getRowInfo(args.target)); 
      } 
    } 


Please get back to us, if you need further assistance. 

Regards, 
Manivel 


Viktor
Replied On August 28, 2019 09:27 AM UTC

Thank you Manivel for your quick response !
it works perfectly.
regards
Viktor

Manivel Sellamuthu [Syncfusion]
Replied On August 28, 2019 09:31 AM UTC

Hi Victor, 

We are happy to hear that your requirement has been achieved. 

Please get back to us, if you need further assistance. 
 
Regards, 
Manivel 


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