I\'m trying to bring a data table layout with pagination that has checkbox selection for data in it. I\'m able to select a page\'s data and when I move to another page, and sele
The problem is discussed on github:
DataTable selection with pagination
To help you now:
HTML:
TS:
class Test {
private data: MyData[];
selectedData: MyData[];
onTableHeaderCheckboxToggle(event: any) {
if (event.checked === true) {
for (let m of this.data) {
if (/* Make your test here if the array does not contain the element*/) {
this.selectedData.push(m);
}
}
} else {
this.selectedData.length = 0;
}
}