-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[docs][DataGrid] Add pagination number formatting doc with a demo #19221
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
Conversation
Deploy preview: https://deploy-preview-19221--material-ui-x.netlify.app/ Updated pages: Bundle size report
|
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.
LGTM
docs/data/data-grid/localization/PaginationNumberFormatting.tsx
Outdated
Show resolved
Hide resolved
To format large numbers in the pagination component, customize the `paginationDisplayedRows` with the following code: | ||
|
||
```jsx | ||
import { DataGridPro } from '@mui/x-data-grid-pro'; |
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.
We must always use the version that matches the docs context when we can, by default MIT.
import { DataGridPro } from '@mui/x-data-grid-pro'; | |
import { DataGrid } from '@mui/x-data-grid'; |
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 DataGrid won't work in this case because the pagination is not allowed to be more than 100.
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.
I will add this info at the beginning of the section
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 DataGrid won't work in this case because the pagination is not allowed to be more than 100.
This would be news for me. People can paginate without limits in the MIT version. Let's remove the Pro component usage.
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.
Please take a look at this https://stackblitz.com/edit/3cvdpmsl?file=src%2FDemo.tsx

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.
@michelengelen just want to confirm with you before merging this PR. Do you think it make sense for this section to target DataGrid Pro and above (given the error from the image above)?
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.
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.
Then I think it's better to switch to the community version. Let me update the demo.
Signed-off-by: Siriwat K <[email protected]>
docs/data/data-grid/localization/PaginationNumberFormatting.tsx
Outdated
Show resolved
Hide resolved
docs/data/data-grid/localization/PaginationNumberFormatting.tsx
Outdated
Show resolved
Hide resolved
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.
Thank you for the recipe. Looks really nice. 🙌
First step of #13222
Preview: https://deploy-preview-19221--material-ui-x.netlify.app/x/react-data-grid/localization/#pagination-number-formatting