Wednesday, March 16, 2016

Turning off jQuery DataTables pagination when all the records are displayed.

This bit of code when added to your jQuery DataTables configuration will turn off pagination if all the records are displayed on one page.

,drawCallback: function(settings){
     if(settings._iRecordsDisplay >= settings._iDisplayLength){
          $('.dataTables_paginate').show();
      }else{
      $('.dataTables_paginate').hide();
      }
}

No comments:

Post a Comment