How to set the total number of pages in data tables

I am using Laravel Pagination with DataTables. How can I set the total number of pages for a table based on a collection. i.e

var table = $('#table_id').DataTable( { "iDisplayLength":10, "recordsTotal":3615, "pagingType": "full_numbers" } ); 
+6
source share
1 answer

@Awais,

There are no records for DataTable. Try running fnDraw () after dynamically adding data to the table via fnAddData ().

It is assumed that DataTables automatically updates the pagination component after creating the redraw.

Try updating if it works.

0
source

All Articles