How to catch an event on pagination buttons next/previous of the DataTables

前端 未结 1 1900
梦如初夏
梦如初夏 2021-01-12 03:23

Can anybody show me an example of how to catch the events on pagination buttons next/previous of datatables? In particular I\'m interested for the \"next\" button. It would

相关标签:
1条回答
  • 2021-01-12 03:52

    Use the code below to attach click event handler to "Next" pagination button.

    var table = $('#example').DataTable({
       drawCallback: function(){
          $('.paginate_button.next:not(.disabled)', this.api().table().container())          
             .on('click', function(){
                alert('next');
             });       
       }
    });   
    

    See this jsFiddle for code and demonstration.

    0 讨论(0)
提交回复
热议问题