In my Angular component I have checkbox selection enabled for all of my rows, but I am actually trying to only have a selection box for rows that can flower, in other words rows that node.canFlower
property is true.
My checkbox selection is implemented in my component like so:
ngOnInit(): {
...
this.gridOptions.rowSelection = 'single';
this.gridOptions.suppressRowClickSelection = true;
}
I understand that checkbox selection can be enabled/disabled via a function colDef.checkboxSelection
that returns true/false according to the official documentation. How do I remove checkboxes for rows that node.canFlower = false
?
Not tested, but it should be close:
const columnDefs = [
{
headerName: 'ID',
field: 'id',
checkboxSelection: function(params) {
return params.node.canFlower;
},
},
];
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments