RukaDo
RukaDo

Reputation: 165

How to reset the state of datagrid and set page of clr-datagrid-pagination back to 1

So I have a datagrid which fetch all and a search menu. I have an issue when I move to page 4 and then search for some specific items only, it would replace all the data in the grid with a new datas but the page stay at page 4th instead of 1. I need it to be 1 since new datas are not related to old ones

Upvotes: 1

Views: 741

Answers (2)

Albena Kertova
Albena Kertova

Reputation: 151

I have the exact same scenario. The above solution did the fix:

@ViewChild('pagination') pagination: ClrDatagridPagination;

// reset page

this.pagination.currentPage = 1;

Upvotes: 0

RukaDo
RukaDo

Reputation: 165

Found out that I can use ClrDatagridPagination as a viewchild to control. @ViewChild('pagination') pagination: ClrDatagridPagination;

Upvotes: 3

Related Questions