1 Reply Latest reply on Jul 30, 2012 12:45 PM by Brendan Healey

    attribute of onrowclick in component <rich:dataTable>

    roger James Newbie

        I want to user <rch:dataTable>.when i click one of rows, this row style could be change,and i click another,now i want to resume the row's style  the first time i click.how to do?

       

      the source like this:

       

       

       

       

      <rich:dataTable id="table" value="#{stockInBB.dataModel}" var="row"

             onrowclick="this.style.fontWeight='bold'"

         rows="#{stockInBB.pager.pageSize}"

        • 1. Re: attribute of onrowclick in component <rich:dataTable>
          Brendan Healey Master

          I went to delete my first reply as it was misleading but all my replies disappeared. Not having a good day.

          Here's a solution which assumes that the text in the table row is wrapped in a div which can be checked

          using your browser developer tools:

           

          <h:outputScript name="jquery.js"/>

            ...

          onrowclick="jQuery('div', this).css('font-weight', 'bold')"

           

          Row highlighting with css:

           

          tr:hover {

              background-color: #ff8080;

          }

           

          Regards,

          Brendan.