-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[DataGrid] Support Checkbox component slot #1528
Conversation
Would we want to create 2 separate component slots, one for checkbox header and another for checkbox cell? Or one? Currently it is |
@ZeeshanTamboli The initial problem I wanted to solve is the customization of the look and feel, not the functional behavior. It was about preparing the unstyled components, so the former option (1 component). |
Request for review so that if it looks fine I can move on to cover it up with tests. Only if it would be worth it to have coverage for this? |
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.
- It looks good at a high level
- Changes might conflict with [core] Simplify component type #1552
- I had initially opened the issue for https://material-ui.com/components/data-grid/style, but not that I think about it, it feels like this customization should be implemented with the theme overrdes.
Well I thought this was good to take as I saw some upvotes for this at #281 (comment) |
@ZeeshanTamboli It's still bringing value, my point is that we likely don't want to use the new option in the theming demos. |
Quick question on how this approach might work. <Checkbox icon={<FavoriteBorder />} checkedIcon={<Favorite />} name="checkedH" />
|
@EdmundsEcho if you only want to change the look and feel of the checkboxes in the data grid, and not the whole app, using a components prop once this PR land is probably the most effective. Otherwise, you could nest the theme providers. |
@oliviertassinari Thank you for the response. Has it been confirmed/is there any reason to believe the data grid does not read the default props of the custom theme? I ask because the following entry is not being applied to the data-grid: ...
props: {
MuiButtonBase: {
disableRipple: true,
},
MuiCheckbox: {
disableRipple: true,
checkedIcon: <Check />,
icon: <Clear />,
},
...
}
} UpdateI just confirmed that it does update the data grid i.e., it works as expected. Apologies for taking time here. |
@EdmundsEcho If you want to check with Also I think |
packages/grid/_modules_/grid/components/columnSelection/GridCellCheckboxRenderer.tsx
Outdated
Show resolved
Hide resolved
…llCheckboxRenderer.tsx Co-authored-by: Olivier Tassinari <[email protected]>
@ZeeshanTamboli Thank you for the FYI. I greatly appreciate it. I will give the version you pointed me to later this week. In the meantime, I'm somewhat surprised to learn that I can use the |
8c180ea
to
7b5003f
Compare
If you want to customize the checkbox of data grid in any way you want it would be better to use the
I think for this you can use |
Got it. That is my understanding too. I just wanted to make sure I did not miss something; there is no way to set the icon prop using the overrides key, but you can do so using the props key (and once the PR lands, using the data-grid components slot reserved for the checkbox). Thank you!! |
Just commenting to let you'll know this was ready for review. |
Nice and clean 👍 |
Thanks. If we are considering #1552, waiting for it to be merged to make some type changes here as well before I merge this. |
Closes #281