Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does tablesorter have a onsort event?

I've just downloaded tablesorter and got it up and running.

I need some code to run each time the user sorts the table, and I cant find anything in the documentation :-(

So if anyone know that would be great, thanks!

Is there a event that is triggered each time i sort a column? I need to be the event AFTER the sorting is done

like image 991
Jason94 Avatar asked Aug 12 '11 06:08

Jason94


1 Answers

You can bind 'sortEnd' to the tablesorter, see the documentation:

http://tablesorter.com/docs/example-triggers.html

from the tablesorter documentation:

$(document).ready(function() { 
    // call the tablesorter plugin, the magic happens in the markup 
    $("table").tablesorter(); 

    //assign the sortStart event 
    $("table").bind("sortStart",function() { 
        //do your magic here
    }).bind("sortEnd",function() { 
        //when done finishing do other magic things
    }); 
}); 
like image 95
Tim Avatar answered Sep 28 '22 00:09

Tim