Forums Register Login

Datatable rows onMouseOut color change

+Pie Number of slices to send: Send
hi,

I have a problem in applying colors for data table.

I have given rowClasses="oddRow , evenRow". These classes contain different bg colors. So while rendering I'll get alternate colors for rows.

My requirement is to have a third color for rows while 'onmouseover'. So I had ' rowOnMouseOver="thirdColor" '. Now on mouse out, I need to get the same alternate colors for odd and even rows. I dont know how to give onmouseout for oddrows and evenrows seperately

I'm using tomahawk's datatable. Please help.

Augustine
+Pie Number of slices to send: Send
Hi,

I am using the following to print the same requirement using t:dataTable.

rowClasses="even,odd"
rowOnMouseOver="this.style.backgroundColor='#9ACD32';"
rowOnMouseOut="this.style.backgroundColor='#{tableBackgroundColor}';"

Thanks
+Pie Number of slices to send: Send
hi,

Thanks for the reply. I did not get what 'tableBackgroundColor' is in "rowOnMouseOut="this.style.backgroundColor='#{tableBackgroundColor}';""... Is it like we need to have color in backing bean or ...?? Can you please elaborate.
+Pie Number of slices to send: Send
hi,

I got it.

rowOnMouseOver="if (!this.oldClassName){this.oldClassName=this.className;} this.className='dataRowHover'"
rowOnMouseOut="this.className=this.oldClassName"

I tried this in mine. It worked. I'm sure it'll work for any style class.
I got this logic in a mail-archive site from apache.org
You guys wanna see my fabulous new place? Or do you wanna look at this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2186 times.
Similar Threads
logic iterate
JSF: tomahawk dataTable rowStyleClass problem while applying alternate colors to rows
retain row highlighting after selecting a row in datatable
different colors to different rows
JButton onClick change background color
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 08:36:11.