How can I turn off the hover highlight for certain rows?

I am running python 3.12.4 dash 2.17.1 dash_ag_grid 31.2.0 on linux OpenSUSE Tumbleweed

I am using Dash AG Grid to build a table.

I use a getRowStyle{} statement to control the formatting style of certain rows as follows.

    getRowStyle = {
        "styleConditions": [
            {"condition": "params.data['Strategy Name'] === 'example3'", "style": {"backgroundColor": "#236d8c",},},
            {"condition": "params.data['Strategy Name'] === 'example4'", "style": {"backgroundColor": "#267da1",},},
        ],
    },        

Is there a style that can be used to turn off the hover highlight for these rows only? Or another way to turn off the hover highlight for these rows only?

Thank you.

Just to flesh out the question a little.

  1. There is a dashGridOptions suppressRowHoverHighlight that supresses hover highlight on all rows.

dashGridOptions = {“suppressRowHoverHighlight”: True}

  1. There are AG Grid CSS variables that affect the hover highlight of specific rows.

-ag-row-hover-color = ‘transparent’

What I cannot figure out is how to use the AG Grid CSS variables in Dash AG Grid.

Any help greatly appreciated.

Gato

Hello @gatomulato,

You should be able to use the row class rules and then on that class adjust the variable:

.new-row-class {
    -ag-row-hover-color: "transparent"
}
1 Like