Skip to content
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

Open
wants to merge 22 commits into
base: v6.x
Choose a base branch
from

Conversation

jimshepherd
Copy link

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.

@mui-bot
Copy link

mui-bot commented Mar 2, 2023

Netlify deploy preview

Netlify deploy preview: https://deploy-preview-8099--material-ui-x.netlify.app/

Updated pages

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 674.6 933.1 705.4 782.58 119.811
Sort 100k rows ms 581.8 1,140.7 581.8 889.28 191.554
Select 100k rows ms 223.1 299.9 288 270.04 32.194
Deselect 100k rows ms 140.2 289.3 201.1 207.76 47.96

Generated by 🚫 dangerJS against 82e64d7

@zannager zannager added the component: data grid This is the name of the generic UI component, not the React module! label Mar 2, 2023
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 2, 2023
@github-actions
Copy link

github-actions bot commented Mar 2, 2023

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@m4theushw m4theushw self-requested a review March 2, 2023 21:08
@github-actions github-actions bot added PR: out-of-date The pull request has merge conflicts and can't be merged and removed PR: out-of-date The pull request has merge conflicts and can't be merged labels Mar 3, 2023
@github-actions
Copy link

github-actions bot commented Mar 3, 2023

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 3, 2023
Copy link
Member

@m4theushw m4theushw left a 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.

@m4theushw m4theushw changed the title [DataGrid] Implement multipleSelect column type [DataGrid] Implement { multipleSelect{ column type Mar 13, 2023
@m4theushw m4theushw changed the title [DataGrid] Implement { multipleSelect{ column type [DataGrid] Implement multipleSelect column type Mar 13, 2023
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 13, 2023
@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@DanailH DanailH added the CLA: required See https://www.notion.so/mui-org/CLA-Contributor-License-Agreement-92ece655b1584b10b00e4de9e67eedb0 label Mar 15, 2023
docs/data/data-grid/column-definition/ColumnTypesGrid.tsx Outdated Show resolved Hide resolved
};

return (
<rootProps.slots.baseMultipleSelect
Copy link
Member

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.

image

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

Copy link
Member

@MBilalShafi MBilalShafi Mar 23, 2023

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.

Copy link
Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLA signed, thanks.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 24, 2023
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 24, 2023
@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 28, 2023
@zannager zannager added CLA: signed See https://www.notion.so/mui-org/CLA-Contributor-License-Agreement-92ece655b1584b10b00e4de9e67eedb0 and removed CLA: required See https://www.notion.so/mui-org/CLA-Contributor-License-Agreement-92ece655b1584b10b00e4de9e67eedb0 labels Mar 28, 2023
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 28, 2023
@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA: signed See https://www.notion.so/mui-org/CLA-Contributor-License-Agreement-92ece655b1584b10b00e4de9e67eedb0 component: data grid This is the name of the generic UI component, not the React module! PR: out-of-date The pull request has merge conflicts and can't be merged v6.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants