Skip to content

Displays Empty View on Subsequent Pages with Pre-Filtered API Data #326

Open
@mohdwaseem

Description

@mohdwaseem

Describe the bug
When passing pre-paged data from an API to X.PagedList.Mvc.Core for display, only the first page is shown. Clicking on the second page (or any subsequent page) results in an empty view. This occurs because the data is already filtered on the API side, and X.PagedList.Mvc.Core fails to handle the pre-filtered enumerable list correctly, despite providing the total result count, page number, and paged result.

To Reproduce
Steps to reproduce the behavior:

Load the paged result from an API.
Pass the result (enumerable list, total count, page number) to X.PagedList.Mvc.Core.
Display the first page successfully.
Click on the second page in the pager.
Observe an empty view.

Expected behavior
When pre-paged data (an enumerable list) is passed to X.PagedList.Mvc.Core along with the total result count, page number, and paged result fetched from the API, the component should correctly display the results for all pages, not just the first page.

Desktop (please complete the following information):

  • OS: Windows
  • Browser chrome
  • Version: X.PagedList.Mvc.Core (10.5.7)
  • Dotnet version: Dotnet 8

** Additional Context **
The issue seems to stem from X.PagedList.Mvc.Core not properly handling pre-filtered data from the API.
Ensure the library supports scenarios where the data is already paged on the backend and only needs to be rendered on the frontend with correct pagination.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions