Ag-grid RowStyle with selected row

亡梦爱人 提交于 2019-12-12 05:37:34

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!