Skip to content

Commit 04bff9b

Browse files
committed
Update demo
1 parent d3de7ae commit 04bff9b

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

docs/data/data-grid/server-side-data/ServerSideLazyLoading.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import * as React from 'react';
2-
import { DataGridPro } from '@mui/x-data-grid-pro';
2+
import { DataGridPro, GridToolbar } from '@mui/x-data-grid-pro';
33
import { useMockServer } from '@mui/x-data-grid-generator';
44

55
function ServerSideLazyLoading() {
66
const { columns, fetchRows } = useMockServer(
7-
{},
7+
{ rowLength: 120 },
88
{ useCursorPagination: false, minDelay: 300, maxDelay: 800 },
99
);
1010

@@ -32,7 +32,13 @@ function ServerSideLazyLoading() {
3232

3333
return (
3434
<div style={{ width: '100%', height: 400 }}>
35-
<DataGridPro columns={columns} unstable_dataSource={dataSource} lazyLoading />
35+
<DataGridPro
36+
columns={columns}
37+
unstable_dataSource={dataSource}
38+
slots={{ toolbar: GridToolbar }}
39+
lazyLoading
40+
paginationModel={{ page: 0, pageSize: 12 }}
41+
/>
3642
</div>
3743
);
3844
}

docs/data/data-grid/server-side-data/ServerSideLazyLoading.tsx

+9-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ import {
33
DataGridPro,
44
GridDataSource,
55
GridGetRowsParams,
6+
GridToolbar,
67
} from '@mui/x-data-grid-pro';
78
import { useMockServer } from '@mui/x-data-grid-generator';
89

910
function ServerSideLazyLoading() {
1011
const { columns, fetchRows } = useMockServer(
11-
{},
12+
{ rowLength: 120 },
1213
{ useCursorPagination: false, minDelay: 300, maxDelay: 800 },
1314
);
1415

@@ -36,7 +37,13 @@ function ServerSideLazyLoading() {
3637

3738
return (
3839
<div style={{ width: '100%', height: 400 }}>
39-
<DataGridPro columns={columns} unstable_dataSource={dataSource} lazyLoading />
40+
<DataGridPro
41+
columns={columns}
42+
unstable_dataSource={dataSource}
43+
slots={{ toolbar: GridToolbar }}
44+
lazyLoading
45+
paginationModel={{ page: 0, pageSize: 12 }}
46+
/>
4047
</div>
4148
);
4249
}

0 commit comments

Comments
 (0)