tags:

views:

39

answers:

4

I use the great tablesorter plugin. I need to be able to execute something BEFORE and AFTER the execution of the sort click

How do you ADD a before and after callback method to a plugin that dont have it

A: 

If it doesn't have it, you'll have to dig into the code and add it yourself. If the project has an open repository, consider submitting your contribution.

marcgg
is it possible to capture the click event and to it here ?
marc-andre menard
+3  A: 

Couldn't you use the sortStart and sortEnd triggers?

kgiannakakis
Seems to be the intended purpose.
jensgram
here is the working code with your proposed solution : $("#myTable").bind("sortStart",function() { $("tr:odd").removeClass("odd"); }).bind("sortEnd",function() { $("tr:odd").addClass("odd"); });
marc-andre menard
A: 

Add code to $headers.click(function(e) { .... } inside tablesorter.js file.

Aseem Gautam
A: 

I just got an answer from the author :

Hi!

There is an option for zebra stripes.

Example:
$("#tablesorter-demo").tablesorter({widgets: ['zebra']});

Best regards
Christian
marc-andre menard