How to disable .ui-selected style

UI Components for JSF
Post Reply
starback
Posts: 10
Joined: 26 Mar 2011, 19:58

24 Apr 2011, 02:07

How can I disable .ui-selected style when I set selectionMode="single" in p:datatable?
I want only highlight row OnMouseOver event. Is any way to do this?

healeyb
Posts: 365
Joined: 07 Apr 2010, 16:05

24 Apr 2011, 13:34

This should do it:

Code: Select all

.ui-datatable .ui-datatable-data tr.ui-state-highlight.ui-selected {
    background: white;
}

starback
Posts: 10
Joined: 26 Mar 2011, 19:58

24 Apr 2011, 20:19

This should do it:

Code:
.ui-datatable .ui-datatable-data tr.ui-state-highlight.ui-selected {
background: white;
}
when I click on the row will be white and no highlight onMouseOver event.
Rows can not be clickable.
Sorry for bad english :oops:

healeyb
Posts: 365
Joined: 07 Apr 2010, 16:05

24 Apr 2011, 22:21

Dude, I've told you how to do it, I can't choose your colours.

starback
Posts: 10
Joined: 26 Mar 2011, 19:58

24 Apr 2011, 23:33

yes, but when I click on a row, he changes color to the one that I set.
All the time is set to this color, because it is selected.
and do not highlight when the mouse is over that row
Here is my css:

Code: Select all

.ui-state-highlight {
	border: 1px solid;
	background: #ECF9FF;
}

.ui-datatable .ui-datatable-data tr.ui-state-highlight.ui-selected {
	background: white;
}

td {
	cursor: default;
}

healeyb
Posts: 365
Joined: 07 Apr 2010, 16:05

25 Apr 2011, 17:52

my mistake, try this also (I don't think my choice of colour is that great!):

Code: Select all

.ui-datatable .ui-datatable-data tr.ui-state-highlight {
    background: #dfdfdf;
}

starback
Posts: 10
Joined: 26 Mar 2011, 19:58

27 Apr 2011, 17:58

It's not working.
After click a row the highlight stays even when the mouse is not over it.
Any ideas?

aliirawan
Posts: 26
Joined: 15 Nov 2010, 20:09
Location: Jakarta, Indonesia
Contact:

27 Apr 2011, 23:02

How bout this one

Code: Select all

.ui-datatable tr.ui-state-highlight {
	cursor: pointer;
	background: green;
}

.ui-datatable tr {
	background: white;
	border-color: #ddd;
}

.ui-datatable tr.ui-selected {
	background: white;
	border-color: #ddd;
}
you can change to others color.
well i go deep through the datatable.js
the mechanism addClass removeClass toggleClass is using jQuery
hope it helps
you can change the color in your own.
I like to explore new things. There's a way for everything. I believe.

starback
Posts: 10
Joined: 26 Mar 2011, 19:58

27 Apr 2011, 23:49

Now the problem is the same as in 5 post :(
I think it is not possible by changing the css, becouse slyles .ui-selected and ui-state-highlight are assigned to the row after clicking on it.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 32 guests