CSS for DataTable hover

UI Components for JSF
Post Reply
bobd
Posts: 6
Joined: 23 Oct 2011, 21:18

02 Dec 2011, 21:40

I'd like to highlight the current row when the mouse hovers over the row. I've tried several approaches, including the following:

Code: Select all

tr.ui-datatable-even:hover, tr.ui-datatable-even:active,
tr.ui-datatable-odd:hover, tr.ui-datatable-odd:active {
	background-color: #78BCFF;
}
.ui-datatable .ui-datatable-data tr.ui-state-hover,
.ui-datatable .ui-datatable-data tr.ui-state-active {
	background-color: #78BCFF;
}
.ui-datatable tbody tr.ui-selected td {
	background-color: #78BCFF;
}
.ui-datatable tbody tr.ui-state-highlight td {
	background-color: #78BCFF;
}
What am I doing wrong? Thanks.
-----------------------------
PrimeFaces 3.4
Mojarra 2.1.7
Tomcat 7.0.23
Liferay 6.1

porthos
Posts: 122
Joined: 09 May 2011, 03:17

03 Dec 2011, 01:28

Try:

Code: Select all

.ui-datatable tr.ui-datatable-even:hover, .ui-datatable tr.ui-datatable-odd:hover {
    background: #78BCFF;
}
This is a css question. Not primefaces.
-------
PrimeFaces 3.4, Glassfish 3.1.2, Mojarra 2.1.6

bobd
Posts: 6
Joined: 23 Oct 2011, 21:18

03 Dec 2011, 23:40

Thanks for the response; it seems to work. And it's not just a CSS question, because CSS classes defined and attached by PrimeFaces are generated by the component (and are not under my complete control). Think themes.
-----------------------------
PrimeFaces 3.4
Mojarra 2.1.7
Tomcat 7.0.23
Liferay 6.1

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

04 Dec 2011, 22:00

But you can easily see what classes pf adds, so it still is 'just' acss issue ;)

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 33 guests