I'm using PrimeNG and Angular 14. I have a checkbox in my p-table
<p-tableCheckbox (click)="onSelectAll($event)"></p-tableCheckbox>
I would like to know if the state of the box is checked or unchecked. So I tried
onSelectAll(event: any) { if (event.checked) { this.selectedCustomers = this.customers.slice(); // select all } else { this.selectedCustomers = []; // unselect all } }
but "event.checked" is repeatedly undefined. I also tried "event.target.checked" but to no avail. How do I tell if my checkbox is checked or not?
Aucun commentaire:
Enregistrer un commentaire