I am trying to colorize rows based on their rank. I found-out that I have to use gridOptions. But, I have failed to use it propertly.
This is what I've done so far:
In the html file:
<ag-grid-angular
style="width: 5000px ; height: 1000px;"
class="ag-theme-balham"
[rowData]="rowDataBia"
[columnDefs]="columnDefsBia"
[gridOptions]="gridOptions"
>
</ag-grid-angular>
In the component, this is the relevant code:
private gridOptions: GridOptions;
gridOptions.getRowStyle = function(params) {
if (params.node.rowIndex % 2 === 0) {
return { background: 'red' }
}
}
As I said this doesn't work.
Can someone please tell me what am I doing wrong and maybe how to fix it?
Thank you.