【问题标题】:Primefaces treetable selected rows background colorPrimefaces treetable 选定的行背景颜色
【发布时间】:2013-07-17 17:20:51
【问题描述】:

在树表中,当节点被选中时,行变为灰色。

如何自定义 primefaces 以在它们被选中时保持白色?

谢谢!

(我从 Primefaces 展示 https://www.primefaces.org/showcase/ui/data/treetable/selection.xhtml 得到这张截图)

【问题讨论】:

标签: jsf primefaces


【解决方案1】:

您需要覆盖它使用的样式类。

在您的 xhtml 文件中添加以下代码

    <style type="text/css">
/* this is to set proper font size */
   .ui-widget,.ui-widget .ui-widget {
        font-size: 90% !important;
    }

    /* To change background color when selectedis-->*/
    .ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight
        {
        background-color: green;
    }
    </style>

试试这个,它应该可以工作。

如何找到:

在树上使用 Firefox 浏览器 right click 并单击 "Inspect Element(Q)"。它将显示它正在使用的样式。它向我展示了上面的标签,所以我只是覆盖它。

你需要对CSS了解一点。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-01-09
  • 2011-08-14
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多