-
-
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
Conversation
34a1aa0
to
1a44f0e
Compare
Deploy preview: https://deploy-preview-11682--material-ui-x.netlify.app/ Updated pages: |
@@ -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. |
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.
You should either provide an array of: | ||
|
||
- **numbers**, each number will be used for the option's label and value. | ||
|
||
- **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 comment
The reason will be displayed to describe this comment to others. Learn more.
useful for language strings such as 'All'
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 comment
The 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 pageSizeOptions
.
Signed-off-by: Olivier Tassinari <[email protected]>
You can configure the page size the user can choose from with the `pageSizeOptions` prop. | ||
|
||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong, it's not Array<number> | Array<object>
but Array<number | object>
.
Signed-off-by: Olivier Tassinari <[email protected]>
Signed-off-by: Olivier Tassinari <[email protected]>
pageSizeOptions
docs
pageSizeOptions
docspageSizeOptions
prop documentation
This is a continuation of #9438. I saw this from mui/material-ui#40589
Preview https://deploy-preview-11682--material-ui-x.netlify.app/x/react-data-grid/pagination/#page-size-options