This content has been marked as final.
Show 4 replies
-
1. Re: .rich-table-row not behaves like .tr
nimo22 Nov 20, 2008 8:12 PM (in response to nimo22)I do some prototype to color all odd table rows in my rich:dataTable:
This works, but for ALL tr's:"$$(tr:nth-child(odd)').invoke('addClassName', 'myClass)"
I only want to set my rich:dataTable tr's:
But the selection of my ID richTable does not work:"$('richTable').$$(tr:nth-child(odd)').invoke('addClassName', 'myClass)"
What is wrong? -
2. Re: .rich-table-row not behaves like .tr
nbelaevski Nov 20, 2008 9:05 PM (in response to nimo22)Hi,
I've created an issue about wrong class used: https://jira.jboss.org/jira/browse/RF-5007 -
3. Re: .rich-table-row not behaves like .tr
nbelaevski Nov 20, 2008 9:07 PM (in response to nimo22)$('richTable')
try to use$(#{rich:clientId('richTable')})
instead -
4. Re: .rich-table-row not behaves like .tr
nimo22 Nov 21, 2008 4:58 AM (in response to nimo22)Okay this code works, but styles all odd rows of my site:
<script> $$('tr:nth-child(odd)').invoke('addClassName', 'myStyle') </script>
I only want to style the odd rows of my datatable and not all rows of my site, so I tried that:<script> $('#{rich:clientId('dataTableViewUsers')}').$$('tr:nth-child(odd)').invoke('addClassName', 'myStyle') </script>
But the failure occurs:$("mySite:myRichTable").$$ is not a function
(So the correct ID of my table is found..).
I tried it also this way and no failure occurs. However, no rows get styled:<script> $$('#{rich:clientId('dataTableViewUsers')} tr:nth-child(odd)').invoke('addClassName', 'myStyle') </script>
Well, I guess, it s prototype-specific and not really a richfaces-problem..