alfajango / jquery-dynatable

A more-fun, semantic, alternative to datatables
http://www.dynatable.com
Other
2.77k stars 363 forks source link

On sort/page change, run function #246

Closed afagard closed 7 years ago

afagard commented 8 years ago

http://stackoverflow.com/questions/37382380/dynatable-on-sort-page-change-run-function

dnsBlah commented 8 years ago

Hi I know this ia an older issue, but I'm facing the same issue.

Currently I worked it out using:

 $(".dynatable-sort-header").on('click', function(event) { myfunctioncall here }

$("table#myTableIDhere").dynatable().on("dynatable:afterProcess", dyntablePagination());  
    function dyntablePagination()  {
         $(document).on('click', '.dynatable-page-link', function() {
             setTimeout(function(){
                 myfunctioncall here
             },0);
         });
     }

For some reason I have to set the paginitation links function in a timeout.. even tho it's 0, it won't work without the timeout.

afagard commented 7 years ago

Sorry for late reply. But switch to DataTables... way better.