Efficiently naviagte and organize through large datasets using OpenGridX's sorting and pagination engines.
Sorting can be toggled by clicking column headers. It supports single-column and multi-column (Shift+Click) sorting.
| Prop | Type | Description |
|---|---|---|
sortingMode |
'client' | 'server' |
Whether to sort locally or on the server. |
sortModel |
GridSortItem[] |
Controlled state of active sorts. |
onSortModelChange |
(model) => void |
Callback triggered when sorting changes. |
Disable sorting for specific columns in GridColDef:
{ field: 'actions', sortable: false }OpenGridX supports standard page-based pagination and infinite scrolling.
<DataGrid
pagination
paginationModel={{ page: 0, pageSize: 10 }}
pageSizeOptions={[5, 10, 20, 50]}
/>When using paginationMode="server", you must provide the rowCount and handle page changes in your dataSource.
<DataGrid
pagination
paginationMode="server"
rowCount={1000} // Total rows on server
onPaginationModelChange={(model) => fetchNextPage(model)}
/>| Prop | Type | Default | Description |
|---|---|---|---|
pagination |
boolean |
false |
Enable/disable the pagination footer. |
paginationMode |
'client' | 'server' |
'client' |
Location of the pagination logic. |
pageSizeOptions |
number[] |
[10, 25, 50] |
Options for the rows-per-page selector. |
For a more modern experience, use infinite scroll combined with virtualization.
- Set
paginationMode="infinite". - Implement
onRowsScrollEndor use thedataSource.getRowsmethod to fetch data as the user scrolls.