5 Replies Latest reply on Feb 1, 2008 2:14 PM by sergeysmirnov

    Unable to access DOM objects with jQuery using id

    vst777

      Hi.

      There seems to be a problem using jQuery. I use the following code to set a row of a dataTable to active with onclick event.

      <rich:dataTable id="myTable" styleClass="myTableStyle" .... >
      
      <rich:jQuery selector="table.myTableStyle tr" query="click(function(){jQuery(this).addClass('active_row')})" />
      


      The code above works correctly. The row of the table gets the active_row style. Now I tried this sample using the id of the dataTable in the selector. This time it does not work anymore. Why?

      <rich:dataTable id="myTable" styleClass="myTableStyle" .... >
      
      <rich:jQuery selector="#myTable tr" query="click(function(){jQuery(this).addClass('active_row')})" />
      


      Greetings
      vst777