-
-
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] Implement multipleSelect
column type
#8099
base: v6.x
Are you sure you want to change the base?
Conversation
Netlify deploy previewNetlify deploy preview: https://deploy-preview-8099--material-ui-x.netlify.app/ Updated pages
These are the results for the performance tests:
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
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.
Thanks for the contribution! Did you consider using an Autocomplete for the edit component? I think it suits better this column type. We use it in the filter panel. IMO the Select component is only usable for single selection.
packages/grid/x-data-grid/src/components/cell/GridEditMultipleSelectCell.tsx
Outdated
Show resolved
Hide resolved
multipleSelect
column type
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
}; | ||
|
||
return ( | ||
<rootProps.slots.baseMultipleSelect |
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.
If many items are selected it becomes difficult to see all the selection.
We could render the Autocomplete inside a Portal. There's an example in https://mui.com/x/react-data-grid/recipes-editing/#multiline-editing with a <textarea>
. I built a simplified POC: https://codesandbox.io/s/lucid-andras-d0fzwq?file=/demo.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.
I built a simplified POC: https://codesandbox.io/s/lucid-andras-d0fzwq?file=/demo.tsx
This looks great, maybe we can also add a dedicated example for multipleSelect
and use freeSolo
prop in Autocomplete for more visibility.
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.
@m4theushw Your multiline chip display implementation looks great! I tried implementing your code but the chips do not display while the select box is open. I cannot figure out why my implementation is not working. Any ideas or suggestions to help me debug?
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.
CLA signed, thanks.
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Intended to solve #4410
Implementation of mutlipleSelect column type to allow selection of multiple options per cell value.
This implementation creates a lot of duplicate code to the existing singleSelect code. Let me know if a more DRY solution is preferred, .e.g. BaseSelect classes where appropriate.