Adding Export Buttons Removed My Pagination Menu
Adding Export Buttons Removed My Pagination Menu
Ninja Joe
Posts: 15Questions: 7Answers: 1
I used the following code to create my DataTable:
$( '#builders-datatable' ).DataTable( { scrollX: true, pageLength: 50, pagingType: 'full_numbers',
drawCallback: function() {
$( '.dataTables_paginate > .pagination' ).addClass( 'pagination-rounded' );
}
} );
However, when I added export buttons with:
dom: 'Bfrtip', buttons: buttonSettings,
My pagination menu went away!
$( '#builders-datatable' ).DataTable( { scrollX: true, pageLength: 50, pagingType: 'full_numbers', dom: 'Bfrtip', buttons: buttonSettings,
drawCallback: function() {
$( '.dataTables_paginate > .pagination' ).addClass( 'pagination-rounded' );
}
} );
How can I show both the export buttons AND the pagination menu?
This question has an accepted answers - jump to answer
Answers
Please see this FAQ.
Kevin
This worked a charm, thank you. I personally feel button examples should include the "l" to prevent this from happening, though. For reference, I ended up going with:
You can add the
pageLength
into thebuttons
array to display a page length list of options, as mentioned in the FAQ - that is usually the easiest way. The list of buttons is entirely customisable, which is why it isn't in there by default.Allan