问题
I am using ag-grid 5.1.2 I've configured a getRowStyle function to set the background-color for certain items.
I've noticed that has overridden the 'selected row' color now, so when a row is selected the background will not change to indicate as such.
What is the correct way to still let highlighted row color work with the custom getRowStyle.
Here is the typescript for the rowStyle function:
self.customRowStyle = function (params: AgParams) {
if (!params.data.isShaded) {
return {
'background-color': '#CEDDDD'
};
}
return null;
}
回答1:
Use the getRowClass gridOption instead of getRowStyle. Then in CSS set the appropriate styles for your background row and the brackground row when highlighted.
来源:https://stackoverflow.com/questions/39951433/ag-grid-rowstyle-with-selected-row