Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client cannot render response from Server - GridShared.Pagination.PagingType #414

Open
puchalskipl opened this issue May 7, 2024 · 1 comment

Comments

@puchalskipl
Copy link

Describe the bug
Backend respond with items, e.g.
{ "items": [ { "id": "1" } ], "totals": { "sum": {}, "average": {}, "max": {}, "min": {}, "calculations": {} }, "pager": { "pagingType": "Pagination", "pageSize": 20, "currentPage": 1, "itemsCount": 2, "startIndex": 0, "virtualizedCount": 0, "enablePaging": false } }

Client cannot deserialized it, error message from browser console:
The JSON value could not be converted to GridShared.Pagination.PagingType. Path: $.pager.pagingType | LineNumber: 0 | BytePositionInLine: 9562.

Desktop (please complete the following information):

  • OS: Windows
  • Browser: chrome, edge
  • Version: Client (GridBlazor) 5.0.12, Server (GridMvcCore) 7.0.7
@gustavnavar
Copy link
Owner

gustavnavar commented May 8, 2024

The back-end should return "pagingType": 1 instead of "pagingType": "Pagination".

The JSON serializer that you are using in the controller action serializes enums as string instead of number, that is the default behavior.

Are you using Newtonsoft or System.Text.Json?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants