DataTable - Color Selected Row

UI Components for JSF
Post Reply
ertar
Posts: 3
Joined: 12 Dec 2014, 13:41

20 Jan 2015, 11:50

Hello! I've got a problem with coloring rows in my DataTable: I color all rows on which value is marked as deleted in red. But when I select row with deleted value it shows as gray. So I can't understand, if there is selection of deleted or normal value.
Please, could you suggest how to resolve problem of showing user that selected value is deleted?
I want to color in red the text of selected row with deleted value or color this row in another red color, or something like that?

<p:dataTable id="eventsDT"
var="book"
value="#{dataHolder.books}"
selectionMode= "single"
selection="#{booksController.selectedItem}"
rowKey="#{book.id}"
rowStyleClass="#{book.isDeleted? 'colored' : null}">

.colored {
background-color: #FF0000;
color: #FFFFFF;
}

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

20 Jan 2015, 16:34

Not PF related... Your .colored selector is not 'specific' enough and gets overriden by something else...

https://developer.mozilla.org/en-US/doc ... pecificity

ertar
Posts: 3
Joined: 12 Dec 2014, 13:41

22 Jan 2015, 11:45

Thank you!! It's the answer. Now it's works.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 52 guests