Enable Custom DataTable Pagination

This method will bind the appropriate event handlers to the HTML markup of the "datatables_page_length.html" and the "datatables_page_navigation.html" templates. This module will also set a page parameter to the URL on page change but will not parse it upon initialization. This must happen from the module that initializes the table.

Options

Page Navigation Selector | data-datatable_custom_pagination-page-navigation-selector | String | Optional

Provide a selector for the page navigation container element. This option defaults to ".page-navigation" which is also the class of the datatable_page_navigation.html template.

Page Length Selector | data-datatable_custom_pagination-page-length-selector | String | Optional

Provide a selector for the page length container element. This option defaults to ".page-length" which is also the class of the datatable_page_length.html template.

Events

// Add custom callback once the page is changed (DataTable "info" object contains the new page information).
$('#datatable-instance').on('datatable_custom_pagination:page_change', function(event, info) { ... });

// Add custom callback once the page length is changed (new page length is provided as second argument).
$('#datatable-instance').on('datatable_custom_pagination:length_change', function(event, newPageLength) { ... });
Source: