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] add a "does not contain" filter #13300

Closed
benjimac93 opened this issue May 30, 2024 · 6 comments · Fixed by #14489
Closed

[data grid] add a "does not contain" filter #13300

benjimac93 opened this issue May 30, 2024 · 6 comments · Fixed by #14489
Assignees
Labels
component: data grid This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature feature: Filtering Related to the data grid Filtering feature new feature New feature or request support: premium standard Support request from a Premium standard plan user. https://mui.com/legal/technical-support-sla/

Comments

@benjimac93
Copy link

benjimac93 commented May 30, 2024

Summary

Similar to the 'contains' filter on Data Grid, we've had quite a few customers request an option for "does not contain"

Examples

No response

Motivation

No response

Search keywords: Filter contains
Order ID: 83665

@benjimac93 benjimac93 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 30, 2024
@michelengelen michelengelen changed the title Does not Contain Filter [data grid] add a "does not contain" filter May 30, 2024
@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: Filtering Related to the data grid Filtering feature enhancement This is not a bug, nor a new feature support: premium standard Support request from a Premium standard plan user. https://mui.com/legal/technical-support-sla/ and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels May 30, 2024
@michelengelen
Copy link
Member

Hey @benjimac93
You can easily add your own filter to the columns by following this section in the docs: Create a custom operator

I do agree that we could possibly add a reversed contains filter.
Would there be any objections handling this as a feature request @mui/xgrid ?

@benjimac93
Copy link
Author

not at all :)

@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 author Issue with insufficient information labels May 30, 2024
@michelengelen michelengelen added new feature New feature or request and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels May 30, 2024
@cherniavskii
Copy link
Member

Yes, we miss some options for excluding the data, e.g. "does not contain" and "does not equal" 👍🏻

@KaralyosBela
Copy link

KaralyosBela commented Jul 8, 2024

Hey @cherniavskii create a custom operator this works fine if you use it with the filter button, or with the column filter. I noticed that if you try to use it with the header filters enabled, it crashes. If you edit this example: create a custom operator to use a DataGridPro or Premium and add the headerFilters prop to it, you will get this error: Error: Missing translation for key headerFilterOperatorAbove. Any idea how to fix this?

@cherniavskii
Copy link
Member

We need to do some benchmarks here. Potentially, almost all of the filter operators can be negated, but should we add a new one for each of those? It doesn't seem right. How about adding a negation modifier that can be applied to any filter operator? E.g. a "Not" checkbox that would negate the filter operation.

Copy link

github-actions bot commented Sep 9, 2024

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

We value your feedback @benjimac93! How was your experience with our support team?
If you could spare a moment, we'd love to hear your thoughts in this brief Support Satisfaction survey. Your insights help us improve!

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! enhancement This is not a bug, nor a new feature feature: Filtering Related to the data grid Filtering feature new feature New feature or request support: premium standard Support request from a Premium standard plan user. https://mui.com/legal/technical-support-sla/
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants