You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by newbie newbie <co...@gmail.com> on 2013/08/05 04:09:02 UTC

How to use Jquery with Tapestry

Hi,
I am using jquery/datatable. I want to highlight selected row in the
datatable. There is sample jQuery code that implements that. Here is the
code
var oTable;
var giRedraw = false;
$(document).ready(function() {
/* Add a click handler to the rows - this could be used as a callback */
$("#example tbody").click(function(event) {
     $(oTable.fnSettings().aoData).each(function (){
         $(this.nTr).removeClass('row_selected');
      });
      $(event.target.parentNode).addClass('row_selected');
});
/* Init the table */
oTable = $('#example').dataTable( );

What I did is copy the code into a test.js file and import it. However, it
does not work. I even try changing $ to jQuery but it still does not work.
How do I use Jquery with Tapestry?
Any help would be much appreciated. Thanks.

Re: How to use Jquery with Tapestry

Posted by William Lopes <wi...@gmail.com>.
Hi,

Links for help you:
http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/jquery
http://tapestry5-jquery.com/

Hugs.


2013/8/4 newbie newbie <co...@gmail.com>

> Hi,
> I am using jquery/datatable. I want to highlight selected row in the
> datatable. There is sample jQuery code that implements that. Here is the
> code
> var oTable;
> var giRedraw = false;
> $(document).ready(function() {
> /* Add a click handler to the rows - this could be used as a callback */
> $("#example tbody").click(function(event) {
>      $(oTable.fnSettings().aoData).each(function (){
>          $(this.nTr).removeClass('row_selected');
>       });
>       $(event.target.parentNode).addClass('row_selected');
> });
> /* Init the table */
> oTable = $('#example').dataTable( );
>
> What I did is copy the code into a test.js file and import it. However, it
> does not work. I even try changing $ to jQuery but it still does not work.
> How do I use Jquery with Tapestry?
> Any help would be much appreciated. Thanks.
>