<ejs-grid [dataSource]='data' height='350' (checkBoxChange)="checkBoxChange($event)">
</ejs-grid>
------------------------------------------------------------------------------------------ [app.component.ts] checkBoxChange(args){ console.log(args);
} |
Hi!
First, thanks so much for your answer!
Just in case is any help to someone:
I had an issue with the trigger of this event, sometimes it was triggered and sometimes not... It was because it is only triggered when you click directly on the checbox. I was expecting that if you click anywhere on the row and the checkbox changed its selection, then I was expecting that the event was triggered, but that's not the case.
Best regards,
César A.
Hi César A,
We have reviewed your query about event triggering when checkbox changed its selection. We suggest you to use the rowSelecting which triggers when the row is selected and rowDeselecting event which triggers when the row is deselected in the grid.
We have attached the code snippet and sample for your reference.
[app.component.html]
<ejs-grid [dataSource]='data' allowPaging='true' [enableHover]="false" [allowSorting]='true' [allowSelection]="true" [selectionSettings]="selectOptions" (rowSelecting)='rowSelecting($event)' (rowDeselecting)='rowDeselecting($event)' [editSettings]='editSettings' [toolbar]='toolbar'>
|
[app.component.ts]
rowSelecting(args) { console.log(args); } rowDeselecting(args) { console.log(args); }
|
Sample: https://stackblitz.com/edit/angular-9wrgtc?file=src%2Fapp.component.html,src%2Fapp.component.ts
API Reference:
rowDeselecting: https://ej2.syncfusion.com/angular/documentation/api/grid/#rowdeselecting
rowSelecting: https://ej2.syncfusion.com/angular/documentation/api/grid/#rowselecting
Please let us know if you need any further assistance.
Regards,
Dineshnarasimman M