I want to change the background color of a row in ag-grid table ,on click of the row
i have tried using the getRowStyle and getRowClass, but that seems to work when the table is loaded initially . So i tried with onrowClicked, but doesnt seem to work.
onRowClicked : row => {
if (row.data.hasNewData) {
return { background: '#ff9998 !important'};
} else if (row.data.hasWrongData === 'Yes') {
return { background: '#f5ff8b !important' };
} else if (row.data.hasNoData) {
return { background: '#acff93 !important' };
}
}
i want the row background color to change on click based on different data parameters