App.component.ts
rowDataBound(args) {
if (args.data["Verified"] === false) {
args.row.classList.add("e-disabled");
}
}
rowSelecting(args) {
let removedIndexLength = 0;
if (args.data["Verified"] === false) {
args.cancel = true; // disabled selection for disabled rows
}
if (args.row.length > 1) {
args.rowIndexes.filter(rowIndex => {
if (
this.grid.getRowByIndex(rowIndex).classList.contains("e-disabled")
) {
args.rowIndexes.splice(rowIndex + removedIndexLength, 1);
removedIndexLength--;
}
});
}
} |
Hi Syncfusion Team
Here is the same problem, but my disable checkox is in serial arrangement.
I try to adjust your sample code, and disable checkbox is still ticked after clicking checkbox in the header.
Is there any idea to solve it?
Many thanks.
Hi Sphere,
We have modified the logic for skipping the disabled row while selecting inside the rowSelecting event. Please refer to the below code example and sample link for more information.
rowSelecting(args) { . . . if (args.row.length > 1) { var index = []; args.rowIndexes.filter((rowIndex) => { if (this.grid.getRowByIndex(rowIndex).classList.contains('e-disabled')) { // getting the disabled row indexes index.push(rowIndex); } }); index.forEach((p) => args.rowIndexes.splice(args.rowIndexes.indexOf(p), 1) ); } }
|
https://stackblitz.com/edit/angular-a8rpsx-r6kmcm?file=app.component.ts
Please get back to us if you need further assistance on this.
Regards,
Pavithra S