Skip to content

Conversation

SteveSandersonMS
Copy link
Member

@SteveSandersonMS SteveSandersonMS commented Oct 9, 2023

A simple example of how QuickGrid pagination could support static SSR

Usage:

@inject NavigationManager Nav

<Paginator State="@paging" PageUrl="@PageUrl" />

@code {
    [SupplyParameterFromQuery]
    public string? Page { get; set; }

    private PaginationState paging = new();

    protected override async Task OnParametersSetAsync()
    {
        await paging.SetCurrentPageIndexAsync(Page.GetValueOrDefault(0));
    }

    private string PageUrl(int page)
        => Nav.GetUriWithQueryParameter("page", page);
}

... plus a <QuickGrid ... Pagination="@paging">.

@ghost ghost added area-blazor Includes: Blazor, Razor Components labels Oct 9, 2023
@SteveSandersonMS
Copy link
Member Author

This also fixes an accessibility issue with ARIA attribute (it was aria-title but should be aria-label).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants