I have looked in the ag-grid docs, but haven't found a solution for my problem.
I want for row to change style on change event, or in other words mark it dirty.
Currently my code is like this:
component.html:
<ag-grid-angular
class="ag-theme-material table"
[gridOptions]="gridOptions"
(gridReady)="onGridReady($event)"
(cellValueChanged)="cellValueChanged($event)">
</ag-grid-angular>
component.ts
onGridReady(params) {
this.gridApi = params.api;
}
cellValueChanged(e) {
const { data, oldValue, newValue } = e;
if (newValue != oldValue) {
this.gridOptions.rowStyle = { background: "#E4FFF9" };
}
}
Problem is that on first change event the style isn't applied and when I am re-applying data, all of the rows style's get changed even though the code doesn't even go in to the "IF" condition.
Re-applying data with gridApi.setRowData([]) then gridApi.setRowData(data).
private dataChange() {
this.buyerGridApi.setRowData([]);
let gridData = [];
gridData = [...some code]
this.gridApi.setRowData(gridData);
}