Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Accessing a dataTable's row in javascript

 
Fawad Ali
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I need to change the color of a row through javascript on mouseover. How can I get the row object of datatable by bringing mouse over the row.
 
Tim Holloway
Saloon Keeper
Posts: 18303
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure you need JavaScript to do that. I think CSS alone will handle it. You just need to define an approprate CSS class in the table's rowClasses attribute.
 
Fawad Ali
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Tim,
Thanks a lot for your reply. You provided a lot of help since I joined. Well I tried a css class but its not working. I tried some thing like this

.blue{
background-color:#DBE5F5;
}
.blue:hover{
background-color:#00FF00;
}

and in dataTable

<h:dataTable value="#{viewAllInvoicesBean.invoicesList}" var="invoice" rowClasses="blue" >

but its not working. Thats why I asked for javascript access. Besides the hovering feature never works in Internet Explorer, that is why again I am going for javascript access.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic