mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
3.9k stars 1.19k forks source link

[data grid] add "is not any of " in "singleSelect" type for filters #13584

Open MohammadSobhanSaffary opened 6 days ago

MohammadSobhanSaffary commented 6 days ago

Summary

Description: The current singleSelect component in MUI supports the "is" and "is not" operators, but it would be beneficial to also have an "is not any of" operator. This would allow users to easily exclude a set of options from the selection, which can be useful when the list of options is very long.

Proposed Implementation:

  1. Add a new operator option to the singleSelect component, called "is not any of".
  2. The "is not any of" operator should accept an array of values, and the component should only allow the user to select a value that is not present in the provided array.
  3. Implement the necessary logic in the singleSelect component to handle the "is not any of" operator and update the UI accordingly.
  4. Ensure that the "is not any of" operator works seamlessly with the existing "is" and "is not" operators.
  5. Update the singleSelect component's documentation to include the new "is not any of" operator and provide relevant examples.

Potential Benefits:

  1. Improved user experience when dealing with large sets of options in the singleSelect component.
  2. Increased flexibility in filtering and selecting options, allowing users to more easily exclude unwanted values.
  3. Consistency with the existing "is any of" operator, which provides a multi-select functionality.

Possible Alternatives: While the "is not any of" operator would be a valuable addition, an alternative approach could be to provide a separate multi-select component that allows users to easily exclude a set of options. However, having the "is not any of" operator directly in the singleSelect component would be more convenient and consistent with the existing functionality.

I hope this feature request template is helpful. Please feel free to modify or expand on it as needed when submitting the issue to the MUI GitHub repository. Let me know if you have any other questions!

Search keywords: is not any of , singleSelect column type

michelengelen commented 4 days ago

Hey @MohammadSobhanSaffary Thanks for raising this. We had some similar requests in the past. This makes me think we could do some sort of umbrella task to increase the number of filters available to the user out of the box.

I'll create one and add this to the board. 👍🏼