【问题标题】:Highlight context menu row with different color in ag grid在 ag 网格中突出显示具有不同颜色的上下文菜单行
【发布时间】:2020-10-07 15:37:45
【问题描述】:

Context Menu Row with different color - the last Row

我选择了 4 Row,但不清楚哪个 Row 值包含上下文菜单,因为它们都以相同的颜色突出显示,所以我希望 4th Row 以不同的颜色突出显示。 任何帮助表示赞赏。

【问题讨论】:

    标签: reactjs react-native ag-grid


    【解决方案1】:

    一个简单的解决方案是使用 css 以不同的颜色突出悬停在行上,如下所述example-

    .ag-row-hover {
      /* putting in !important so it overrides the theme's styling as it hovers the row also */
      background-color: #dfdfff !important;
    }
    

    稍微复杂一点的方法是监听上下文菜单事件何时发出,并以不同的行样式突出显示该特定行。

    【讨论】:

    • 这在我的情况下不起作用。我正在添加使用单击上下文菜单的行更新所选行的功能,并且需要此功能来区分所选行和 contetx 菜单行。知道行索引时如何用任何颜色突出显示行的任何想法
    • 感谢您的回复。它适用于此 - ag-theme-alpine .ag-ltr .ag-row-focus { border: 1px solid red; background-color: lightblue; }
    猜你喜欢
    • 2020-10-28
    • 1970-01-01
    • 2012-05-18
    • 2015-03-07
    • 2018-10-15
    • 1970-01-01
    • 2019-09-05
    • 2021-09-16
    • 1970-01-01
    相关资源
    最近更新 更多