mui-datatables
mui-datatables copied to clipboard
How to have last and first page navigation in pagination ?
In pagination we can just navigate to next and previous.
How to navigate directly to first page or last page ? Something as shown below

In order to create your own custom pagination, you will need to use the customFooter option:

You can look at the customize-footer example for more information.
On your customFooter , provide a custom component that has a TablePagination component and supply its ActionsComponent prop
CodeSandbox example: https://codesandbox.io/s/dztrr
You can copy the TableFooter component and its children as your base example.
That CodeSandbox example throws an error on startup...
const { items } = usePagination({
count: total,
showLastButton: true, // add this for show go last button
showFirstButton: true, // add this for show go first button
});
when you are mapping items like
items.map((type) =>{
// you gonna access here type == 'first' and 'last'
})