【发布时间】:2014-06-08 02:54:03
【问题描述】:
我想根据状态列更改行的颜色。
我查看了 primefaces 网站上的示例
http://www.primefaces.org/showcase/ui/datatableColoring.jsf
并在网上查找示例,但我似乎无法让它与我的代码一起使用。
问题是它突出显示了所有内容,而不仅仅是状态设置为“已关闭”的行
这是我的代码
<p:dataTable id="ComplaintTable" var="complainer"
rowKey="#{complainer.id}"
selection="#{bigComplaintsDAO.selectedComplaintRow}"
widgetVar="complaintsTableSearch"
paginator="True" rows="15"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="15,20,30,40,50,100"
resizableColumns="true"
filteredValue="#{bigComplaintsDAO.filteredComplaintRow}"
selectionMode="single" value="#{bigComplaintsDAO.complaintList}"
style="font-size:10px;width:100%;"
rowStyleClass="#{(complaint.status) eq Closed ? 'Closed' : null}">
和 CSS
<style type="text/css">
.Closed
{
background-color: #6CE26C !important;
background-image: none !important;
color: #000000 !important;
}
</style>
【问题讨论】:
标签: css jsf primefaces xhtml datatables