• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Datatable rows onMouseOut color change

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Augustine Chelliah
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Augustine Chelliah
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
incandescent light gives off an efficient form of heat. You must be THIS smart to ride this ride. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic