Completed
Last Updated: 26 Oct 2020 13:34 by ADMIN
Release 2.19.0
ben
Created on: 04 May 2020 16:18
Category: Grid
Type: Bug Report
6
Grid, Paging, Saving / Restoring State - Incorrect Page Requested in OnRead

Example Repo - https://github.com/benhysell/BlazorGridPagingIssue

tldr - OnRead args do not contain the correct page after restoring state without manual intervention.

 

Project Setup

  • Base Blazor Client/Server template with Weather Forecasts as the data
  • Server has a single OData endpoint to return 50 weather forecasts.  Each forecast starts with Temperature 0 and adds 1 per row to allow one to know which page they should be on
  • Client has two pages configured, 'Paging NOT Working' and 'Paging Work Around'

Steps to Reproduce

  • Navigate to 'Page NOT Working', select a page, i.e. page 5, navigate to the Counter page, navigate back to Page NOT Working.
  • Grid will show Page 5 in the page selector, however the data being show in from Page 1
  • Looking at Chrome 'Network' tab the OData query to obtain data from the backend does not contain proper offset for Page 5 data
  • args.Request.Page reports Page 1, however the state of the Grid was just restored to Page 5

Workaround

I currently have a work around, this can be seen in the other page 'Paging Work Around'.

  • On the first call to OnRead I check to see the last Grid state that was stored
  • If the arg.GridState.Page does not match, (Stored vs the Request) I update the Request with the proper Page
  • Proper OData query is generated to the backend.

Expected Behavior

  • After state is restored first call to OnRead() would report the proper Page and make correct OData call.
3 comments
ADMIN
Marin Bratanov
Posted on: 04 May 2020 18:57

Hi Ben,

It's a bug in my view and I have logged it as such. That's why I changed the status to "Unplanned" - it means it is acknowledged as a problem (or a meaningful feature), but we don't know when it will be fixed/implemented yet. You can read more on the statuses on our portal here: https://feedback.telerik.com/blazor/status-info

 

Regards,
Marin Bratanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
ben
Posted on: 04 May 2020 18:54

Marin,

Is this a bug or have I done something incorrect in my configuration / application / expectation on how it should work?

-ben

ADMIN
Marin Bratanov
Posted on: 04 May 2020 18:51

Hello Ben,

Thank you for reporting this and sharing the workaround with the community. I took the liberty to attach the project here as well, so people don't need to go to the repo and so you don't have to maintain it.

Regards,
Marin Bratanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.