Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Server-side pagination. How to reset pagination to page 1 on sort?

I’m using ag-grid-vue enterprise 32.1.0.
Server-side pagination with server-side sort.

When i sort a column, the params passed to getRows() preserve the startRow and endRow of the current page. How can I reset the pagination to page 1 on sort? Staying on the current page makes no sense.

Thank you!

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can reset your pagination to page 1 by setting the paginationGoToPage prop to 0. This will change your pagination to page 1, regardless of your current page, in response to the sort change event.

const onFirstDataRendered = (params) => {
params.api.paginationGoToPage(0);
};

This answer is referenced from the Official AG Grid Documentation.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading