2 Replies Latest reply on Nov 4, 2008 3:57 AM by shubniggurath

    Changing color of a selected row in <rich:dataTable> in depe

    shubniggurath

      Hi

      i'm using <rich:dataTable> and not <rich:ExtendedDataTable> and i want to change the color of the row when i click on a <h:selectBooleanCheckbox> in some column.

      How this would be done?

      Thanks in advance

      Walter

        • 1. Re: Changing color of a selected row in <rich:dataTable> in
          nbelaevski

          Walter,

          Try that:

          <style type="text/css">
           .highlight {
           background-color: lime;
           }
           </style>
          
           <rich:dataTable value="#{paramValues.f}" var="var" id="table">
           <h:column>
           <h:selectBooleanCheckbox styleClass="highlightCheckbox"/>
           </h:column>
           <h:column>
           <h:outputText value="#{var}" />
           </h:column>
           </rich:dataTable>
          
           <rich:jQuery query="click(function(){jQuery(this).attr('checked') ? addClass(this) : removeClass(this)})" selector="#table .highlightCheckbox"></rich:jQuery>
           <rich:jQuery name="addClass" timing="onJScall" query="parents('tr').addClass('highlight')" />
           <rich:jQuery name="removeClass" timing="onJScall" query="parents('tr').removeClass('highlight')" />
          
          


          • 2. Re: Changing color of a selected row in <rich:dataTable> in
            shubniggurath

            Hi ! Thanks, looks good, i'll try it out

            Walter