diff --git a/docs/src/pages/components/data-grid/pagination/AutoPaginationGrid.js b/docs/src/pages/components/data-grid/pagination/AutoPaginationGrid.js index ea6d6ed18e9f8..860d4760fc60f 100644 --- a/docs/src/pages/components/data-grid/pagination/AutoPaginationGrid.js +++ b/docs/src/pages/components/data-grid/pagination/AutoPaginationGrid.js @@ -10,13 +10,8 @@ export default function AutoPaginationGrid() { }); return ( -
Through paging, a segment of data can be viewed from the assigned data source.
-By default, the Grid displays all the rows with infinite scrolling (and virtualization). -Set the `pagination` prop to enable the pagination feature. +By default, the MIT `DataGrid` displays the rows with pagination, and up to 100 rows per page. + +On the other hand, the commercial `XGrid` component displays, by default, all the rows with infinite scrolling (and virtualization) and without the 100 rows per page limitation. You need to set the `pagination` prop to enable the pagination feature in such a case. ## Basic example @@ -34,6 +35,12 @@ By default, this feature is off. {{"demo": "pages/components/data-grid/pagination/AutoPaginationGrid.js"}} +## Custom pagination component + +Head to the [rendering section](/components/data-grid/rendering/#pagination) of the documentation for customizing the pagination component. + +## Server-side pagination + - https://ej2.syncfusion.com/react/demos/#/material/grid/paging - https://devexpress.github.io/devextreme-reactive/react/grid/docs/guides/paging/ - https://www.telerik.com/kendo-react-ui/components/grid/paging/ diff --git a/docs/src/pages/components/data-grid/rendering/CustomPaginationGrid.js b/docs/src/pages/components/data-grid/rendering/CustomPaginationGrid.js new file mode 100644 index 0000000000000..5c627d7ba3e89 --- /dev/null +++ b/docs/src/pages/components/data-grid/rendering/CustomPaginationGrid.js @@ -0,0 +1,56 @@ +import * as React from 'react'; +import PropTypes from 'prop-types'; +import { makeStyles } from '@material-ui/core/styles'; +import { DataGrid } from '@material-ui/data-grid'; +import { useDemoData } from '@material-ui/x-grid-data-generator'; +import Pagination from '@material-ui/lab/Pagination'; + +const useStyles = makeStyles({ + root: { + display: 'flex', + }, +}); + +function CustomPagination(props) { + const { paginationProps } = props; + const classes = useStyles(); + + return ( +Start
+ +## Components + +As part of our customization API, the Grid allows to replace and override the following components: + +- `header`: The component rendered above the column header bar. +- `loadingOverlay`: The component rendered when the loading react prop is set to true. +- `noRowsOverlay`: The component rendered when the rows react prop is empty or []. +- `footer` - The component rendered below the viewport. +- `pagination`: The component rendered for the pagination feature. + +### Pagination + +By default, the pagination uses the [TablePagination](/components/pagination/#table-pagination) component that is optimized for handling tabular data. This demo replaces it with the [Pagination](/components/pagination/) component. + +{{"demo": "pages/components/data-grid/rendering/CustomPaginationGrid.js"}}