Pagination doesn't change after applying filters to grid

1 Answer 326 Views
General Discussions Grid
Darshan
Top achievements
Rank 1
Iron
Iron
Darshan asked on 03 Apr 2023, 08:23 AM | edited on 03 Apr 2023, 08:24 AM

i have implemented pagination and filtering using  the process method .But pagination logic doesnt change after applying filters to columns ?

 Is this expected?

 

 

For example if i have 10 records with page size 5.

Within those 10 records color property is green for 2 records.

Once i type the property in filter section of the grid.

Pagination at the bottom will still show  2 pages .

My expectation is it should show only 1 page after apply this filter since only 2 record satisfy filter criteria.

 

1 Answer, 1 is accepted

Sort by
0
Wissam
Telerik team
answered on 03 Apr 2023, 11:02 AM

Hello, Darshan,

When filtering the data, the pages are expected to change too. For convenience, I prepared an example of the Grid with paging and filtering using the process function and dataStateChange event:

I would suggest comparing the above Grid setup to yours, to see where the faced issue is coming from. In case you are not able to find the origin of the unexpected behavior, could you please send me a runnable example where the issue is present so that I can assist you further? You can use the demo I sent as a base.

For more information about pagination in the KendoReact Grid, you can check the following article:

Regards,
Wissam
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Darshan
Top achievements
Rank 1
Iron
Iron
commented on 03 Apr 2023, 12:23 PM

thanks wissam.

In my case i was passing total prop as well to the grid. Looks like that caused the issue.

Wissam
Telerik team
commented on 03 Apr 2023, 02:12 PM

You are welcome, Darshan!

Basically, the total prop should refer to the total number of data items on all pages of the Grid, and it is necessary to set its value when not using the process function.

On the other hand, the process method returns a DataResult that includes the data and total values where the `total` property here is passed to the total property of the Pager of the Grid component. In this case, it is not needed to set use the total prop, but if you set it, it will be used instead of the value stored in the DataResult.

Tags
General Discussions Grid
Asked by
Darshan
Top achievements
Rank 1
Iron
Iron
Answers by
Wissam
Telerik team
Share this question
or