View as Markdown

API reference: @salmonui/data-grid

DataGridPaginginterface

import type { DataGridPaging } from '@salmonui/data-grid';
interface DataGridPaging {
    page?: number;
    pageSize?: number;
    buttonCount?: number;
    pageSizeOptions?: boolean | readonly (number | 'all')[];
    syncUrl?: boolean | {
        readonly param?: string;
    };
    totalRowCount?: number;
}

paging prop.

DataGridPaging members (6)
NameSignatureDescription
pageoptionalpage?: number;

1-based. Default 1.

pageSizeoptionalpageSize?: number;

Default 12.

buttonCountoptionalbuttonCount?: number;

Numeric page buttons shown at once. Default 8.

pageSizeOptionsoptionalpageSizeOptions?: boolean | readonly (number | 'all')[];

Page size dropdown: true for ['all', 5, 10, 12, 20], or the options ('all' for every row). Default false.

syncUrloptionalsyncUrl?: boolean | { readonly param?: string; };

Keeps the page in the URL query string. Opt-in. After mount the grid reads the parameter (default page) and goes to that page, then writes page changes with history.replaceState (no history entries). The server renders page; pass the parameter as page from the request to render the same page on the server. Read on mount only.

totalRowCountoptionaltotalRowCount?: number;

Total row count for the pager when the data source pages remotely and reports no total (or a wrong one); wins over the source's total. Reactive. Ignored when paging runs locally.