Skip to content

QuickGrid static pagination #51217

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

Closed

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