blazorbootstrap icon indicating copy to clipboard operation
blazorbootstrap copied to clipboard

Grid: Grid Settings - Persist column sorting state

Open jkixj opened this issue 6 months ago • 0 comments

Describe the bug GridSettings currently only includes the pagination and filters. To be able to use these settings to completely restore the state of the grid, e.g. as part of SPA navigation, there needs to be a way to save and restore the full state. In particular, Sorting is currently not saved. For large grids, this makes it difficult for users to find the place they left off.

To Reproduce Steps to reproduce the behavior:

  1. Create a page with a Grid
  2. Implement a GridSettingsProvider that saves the settings to local or session storage and restores them on page load and set GridSettingsChanged to invoke it
  3. In the browser, change the sorting and filters on the Grid
  4. Navigate away from the page
  5. Navigate back to the page
  6. Observe filters have been restored, but sorting has been reset

Expected behavior The state of the grid should be restored fully.

Versions (please complete the following information):

  • BlazorBootstrap: 1.10.4
  • Blazor WebAssembly / Server: Server
  • .NET Version: .NET 8

Desktop (please complete the following information):

  • OS: Windows
  • Browser: All
  • Version: All

Additional context This issue is noted with a warning in the official documentation, but I could not find any actual issue raised for it.

See https://docs.blazorbootstrap.com/components/grid#save-and-load-grid-settings

jkixj avatar Dec 19 '23 13:12 jkixj