-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[docs] Improve data grid pageSizeOptions
prop documentation
#11682
Changes from all commits
1a44f0e
0d17433
86a360c
3ba5593
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,14 +11,20 @@ By default, each page contains 100 rows. The user can change the size of the pag | |
|
||
### Page size options | ||
|
||
You can configure the page size the user can choose from with the `pageSizeOptions` prop. | ||
You can customize the options shown in the "Rows per page" select using the `pageSizeOptions` prop. | ||
You should provide an array of items, each item should be one of these types: | ||
|
||
It's possible to customize the options shown in the "Rows per page" select using the `pageSizeOptions` prop. | ||
You should either provide an array of: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is wrong, it's not |
||
- **number**, each number will be used for the option's label and value. | ||
|
||
- **numbers**, each number will be used for the option's label and value. | ||
```jsx | ||
<DataGrid pageSizeOptions={[5, 10, 25]}> | ||
``` | ||
|
||
- **objects**, the `value` and `label` keys will be used respectively for the value and label of the option (useful for language strings such as 'All'). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
is false information. <DataGrid pageSizeOptions={[{ value: -1, label: 'All' }]}> Doesn't work There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting. Should we support this use case anyways? I wonder if it'd be solved better by turning pagination off rather than supporting it with |
||
- **object**, the `value` and `label` keys will be used respectively for the value and label of the option. | ||
|
||
```jsx | ||
<DataGrid pageSizeOptions={[10, 100, { value: 1000, label: '1,000' }]}> | ||
``` | ||
|
||
{{"demo": "PageSizeCustomOptions.js", "bg": "inline"}} | ||
|
||
|
@@ -32,7 +38,7 @@ You can't use both the `autoPageSize` and `autoHeight` props at the same time be | |
|
||
{{"demo": "PageSizeAuto.js", "bg": "inline"}} | ||
|
||
## Pagination on Pro and Premium | ||
## Pagination on Pro and Premium [<span class="plan-pro"></span>](/x/introduction/licensing/#pro-plan 'Pro plan')[<span class="plan-premium"></span>](/x/introduction/licensing/#premium-plan 'Premium plan') | ||
|
||
The default pagination behavior depends on your plan. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first two sentences says the same thing.