Have datatable and checkboxes. If we select checkboxes across all pages(few records in each page), I'm able to get all JSON data of the selected records, could any one suggest me how disable the selected checkboxes. tried below code for getting json data,
fnGetJsonData() {
const data = this.persons.filter(f => f.checked);
const mappedData = data.map(d => ({
id: d.id,
firstName: d.firstName,
lastName: d.lastName,
dropdown: d.dropdown
}));
this.persons.filter(f => f.checked); // after got json need to disable the checkboxes
console.log(JSON.stringify(mappedData));
}
Demo
Copyright Notice:Content Author:「Rajasekhar」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/67057169/selected-checkboxes-disabling-using-angular