I'm trying to create conditional coloring in my grid based on the data, using the cellClass function in columnDefs. The issue I'm facing is that the classes are not updated when there is a selection change, preventing me from defining colors for selected rows that also have conditional coloring. For example, if some rows are colored red based on data, when they are selected, the color should become a darker red to indicate both the selection and the condition.
Is there a way to achieve this?
Here is my attempt, but it won't work because this function is not called on selection change:
vm.getCellHighlight = function(grid, row, col, rowRenderIndex, colRenderIndex) {
var rowStatus = row.entity.isChild ? grid.parentRow.entity.transactionItemStatus : row.entity.transactionItemStatus;
var rowSelected = row.isSelected ? 'Selected' : '';
var rowType = '';
if (rowStatus == ticketStateStorno){
rowType = 'Storno';
}
if (rowStatus == ticketStateUsed){
rowType = 'Used';
}
return (rowRenderIndex % 2)? 'searchSalesGridHighlight' + rowType + 'Dark' + rowSelected : 'searchSalesGridHighlight' + rowType + 'Light' + rowSelected;
};