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

[data grid] How can I use multi-sort for some columns and single-sort for others? #12453

Closed
crscaballero opened this issue Mar 14, 2024 · 3 comments
Labels
component: data grid This is the name of the generic UI component, not the React module! feature: Sorting Related to the data grid Sorting feature support: commercial Support request from paid users support: question Community support but can be turned into an improvement

Comments

@crscaballero
Copy link

crscaballero commented Mar 14, 2024

The problem in depth

I'm able to enable/disable the sorting feature by column or enable/disable the multi-sorting for the entire DataGrid, but I can';t find a way to enable multi-sorting for a few columns and just single-sorting for the rest

I've looked into the interfaces and doc without success

Your environment

`npx @mui/envinfo`
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: multisorting
Order ID: 78424

@crscaballero crscaballero added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: commercial Support request from paid users labels Mar 14, 2024
@michelengelen
Copy link
Member

Hey @crscaballero,
Yes, that would be possible by using the controlled sorting. Simply define which fields are allowed to be multi-sorted and apply the new sort model based on that. here is an example of that: Controlled Multi-Sort
Would that be a suificient solution for you?

@michelengelen michelengelen added component: data grid This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information feature: Sorting Related to the data grid Sorting feature and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Mar 15, 2024
@michelengelen michelengelen changed the title [question] How can I use multi-sort for some columns and single-sort for others? (DataGrid component) [data grid] How can I use multi-sort for some columns and single-sort for others? Mar 15, 2024
@MBilalShafi MBilalShafi added the support: question Community support but can be turned into an improvement label Mar 18, 2024
@crscaballero
Copy link
Author

Thank you, that was really useful

@github-actions github-actions bot removed the status: waiting for author Issue with insufficient information label Mar 19, 2024
Copy link

⚠️ This issue has been closed.
If you have a similar problem, please open a new issue and provide details about your specific problem.
If you can provide additional information related to this topic that could help future readers, please feel free to leave a comment.

How did we do @crscaballero?
Your experience with our support team matters to us. If you have a moment, please share your thoughts through our brief survey.

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! feature: Sorting Related to the data grid Sorting feature support: commercial Support request from paid users support: question Community support but can be turned into an improvement
Projects
None yet
Development

No branches or pull requests

3 participants