I need to add a 'jump to' functionality to material pagination. it doesn't have built-in method for that so I need to add it manually.
at the moment I have this code:
<mat-paginator [length]="pageLength"
[pageSize]="10"
[pageSizeOptions]="pageLength | checkPageLength"
[showFirstLastButtons]="true">
</mat-paginator>
and it shows: my current pagination and I need it to have a textbox and a 'go' button for jumping to a specific page since I have many pages.
I found a piece of code from here which is working fine for me:
this.paginator.pageIndex = pageNumber;
this.paginator.page.next({
pageIndex: pageNumber,
pageSize: this.paginator.pageSize,
length: this.paginator.length
});
Working_Example
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With