I am using igx-grid
. I am retrieving all data in one call, suppose I am on 3rd page, while filtering data it searching the data from the whole data, and it goes to "Page 1" automatically, I need a way to filter data in current page only and don't paginate to Page 1, it should be on current page only. Is there any way to do the same? Thanks in advance!!!
Edit: I am facing same issue in Server Side Pagination also.
Filtering performed on the data in any column of the
igx-grid
is not an operation which works only on the specific page data, but on the entire data set. If you need only data within the current page to be filtered, then the data within the current page will be less than the page size and the data state in general in the grid will go out of sync.In order to get the current filtered data on the current page with server-side paging, you can extract the
filteringExpressions
from the grid and send them in the request for paging to your backend service. Then first filter the data and subsequently page it and return only the page size back. In pseudo code this will look something like:The result would be something like this: https://stackblitz.com/edit/github-w6x6a7?file=src/app/grid/grid-remote-paging-defaultTemplate-sample/remote-paging-default-template.component.html
Now the grid does reset the pages when client-side filtering is performed, because when filtering the data, the number of pages is reduced and the current page that the user is on may no longer exist.
Examples on the server-side paging and filtering in the
igx-grid
can be found here: https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/remote-data-operations