4 Replies Latest reply on Nov 21, 2008 4:58 AM by nimo stephan

    .rich-table-row not behaves like .tr

    nimo stephan Master

      I have this in my css:

      I want to set the style of a row in a rich-data-table:

      This does not work:

      .myDataTable .rich-table-row {
      
      background: url(../myBackground) 0 0 repeat;
      
      }


      This does work:
      .myDataTable tr {
      
       background: url(../myBackground) 0 0 repeat;
      }



      Another point is,

      why I have to use java-script

      <rich:dataTable styleClass="myDataTable "
       onRowMouseOver="this.style.backgroundColor='#FFFF11'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"...>



      to make a hover-effect on rows, when I can use css:

      This does work in a rich-table without java-script:

      .dataTableSection tr:hover {
      
       backgroundColor="#FFFF11";
      }



      This does not work:

      .myDataTable .rich-table-row:hover{
      
      backgroundColor="#FFFF11";
      
      }


      We do not need java-script to hover a row, but it would be senseful, if we could provide zebra-tables with tags inside a rich:dataTable.

      For example:

      <rich:dataTable styleClass="myDataTable "
       oddRow="this.style.backgroundColor='#FFFF11'" evenRow="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"...>


      oddRow and evenRow with Java-script makes sense, but a hover with java script is not really a need as we can do it with simple css.

      Would it be not better to provide oddRow and evenRow as additional properties for rich:dataTable?