How to use JQuery with Tapestry

158 views
Skip to first unread message

newbie

unread,
Aug 4, 2013, 10:08:43 PM8/4/13
to tapestry...@googlegroups.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.
 

newbie newbie

unread,
Aug 4, 2013, 11:01:20 PM8/4/13
to tapestry...@googlegroups.com
Hi,
Forgot to mention that in my AppModule, I have

configuration.add(JQuerySymbolConstants.SUPPRESS_PROTOTYPE, "false");



 

--
You received this message because you are subscribed to the Google Groups "tapestry5-jquery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tapestry5-jque...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Emmanuel DEMEY

unread,
Aug 5, 2013, 3:28:01 AM8/5/13
to tapestry...@googlegroups.com
Does Tapestry execute your jQuery code ? can you add a console.log or an alert ? 
Do you have javaScript errors ? How did you import the test.js file ? 


2013/8/5 newbie newbie <codeh...@gmail.com>



--
Emmanuel DEMEY
Ingénieur Etude et Développement
ATOS Worldline
+33 (0)6 47 47 42 02
demey.e...@gmail.com

Twitter : @EmmanuelDemey

newbie

unread,
Aug 5, 2013, 5:10:01 AM8/5/13
to tapestry...@googlegroups.com
Hi,
 
Does Tapestry execute your jQuery code ? can you add a console.log or an alert ? 
 
I added the following console.log but the message is not shown on my console.

 $j(document).ready(function() { 
     if (window.console) console.log('Testing Indicator');

 

Do you have javaScript errors ?

My error log is not showing any javaScript errors.

 How did you import the test.js file ? 
 
I use @Import(library={"context:js/test.js"}) . If I replace test.js with a non-existent file, there would be errors in my log. So I guess I am importing it correctly.
 
 

 



     
 
Reply all
Reply to author
Forward
0 new messages