How can I set pageIndex of paginator and it can update itself?
See original GitHub issueBug, feature request, or proposal:
proposal
What is the expected behavior?
For example. When the paginator display 11-20 of 400
, I want to set the pageIndex
to initial state. And after that, I want paginator display 1-10 of 400
.
What is the current behavior?
First page is 0 and current page is 1, the paginator view display 11-20 of 400
.
I set the pageIndex
to initial state like this:
this.paginator.pageIndex = 0;
But the view of paginator not update. Still display 11-20 of 400
.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
"@angular/core": "^4.3.1",
"@angular/material": "^2.0.0-beta.8",
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (4 by maintainers)
Top Results From Across the Web
reset paginator first page angular material - Stack Overflow
You need to use a ViewChild decorator to select the paginator and then set the pageIndex property of the paginator.
Read more >Paginator | Angular Material
When the user interacts with the paginator, a PageEvent will be fired that can be used to update any associated data view.
Read more >Data Table Pagination using Angular Material - Medium
When the user interacts with the paginator, a PageEvent will be fired that can be used to update any associated data view. Page...
Read more >A Demo On Angular(v12) Pagination Using Angular Material ...
In this article, we are going to implement pagination using angular material in a sample angular(version 12) application.
Read more >simplemattable - npm
A simplified, declarative table-library using @angular/material's MatTable with form capabilities for adding/editing/deleting data.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
MatPaginator contains method to move to the first page.
this.paginator.firstPage()
Full solution:
You need to declare paginator dom element as variable using
#paginator
Then set every time you need to set
pageIndex
: