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.92k stars 1.19k forks source link

[data grid] Support filter group / query builder #4217

Open oliviertassinari opened 2 years ago

oliviertassinari commented 2 years ago

Summary 💡

Have the ability to have "and"/"or" filter at the same time.

Benchmarks

Screenshot 2022-03-17 at 17 19 06

https://developers.notion.com/reference/post-database-query

Screenshot 2022-03-17 at 17 20 04 Screenshot 2023-09-27 at 17 13 53

Motivation 🔦

It's meant to solve advanced filtering use cases, similar to what you can do with SQL queries. This feature is not available in Excel.

m4theushw commented 2 years ago

2437 requested the same feature. At that time, the user needed to filter rows that had one value of a list of values, so the isAnyOf operator was created. This operator can be used to create the query from the second screenshot (fields between OR are the same). However, isAnyOf can't be used in cases where the fields differ (first screenshot).

flaviendelangle commented 2 years ago

Related to #3719

I would distinguish two things:

  1. Improve the filtering engine to support models with nested operators
  2. Improve the UI to support these new models

The part 1 can be done without doing the part 2 if we want to allow users to build there UI for a time and then build our own.

Pustelto commented 2 years ago

Hi, it would be great if the engine could support group filters. We will need this feature as well, but we are ok with building our own UI (we already plan to do it anyway). So if at least the point No. 1 could be implemented, that would be a huge help.

Improve the filtering engine to support models with nested operators

Thanks a lot 🙏

vlad-healthhelper commented 1 year ago

Hi everyone, we are having the same issue. We are using the Data Grid Pro and we need to be able to combine ANDs and ORs while filtering. Here is an example of the filter we need: Person name is John AND Person height is more than 6 feet AND (dob is empty OR dob is before 1/1/1990).

Data Grid is awesome! Thank you all for what you put together!

russjman commented 1 year ago

Hi everyone, we are having the same issue. We are using the Data Grid Pro and we need to be able to combine ANDs and ORs while filtering. Here is an example of the filter we need: Person name is John AND Person height is more than 6 feet AND (dob is empty OR dob is before 1/1/1990).

Data Grid is awesome! Thank you all for what you put together!

We are also needing this type of advanced filtering( nested/grouped ). Any idea if this is being worked on or considered? Our team has a pro license

tnoetzel commented 1 year ago

+1

agrauch commented 1 year ago

We would also like to have the ability to group filters

Mengying1717 commented 1 year ago

Hi Everyone, our team has a pro license and we have the same issue here as well. Group filter will be very helpful. Would like to know is this being considered? Thanks!

muckinger commented 7 months ago

We are also Pro-Users and urgently need the ability to group filters. Any plans or Updates? I think this is a very common usecase. Thx!

hdale94 commented 3 months ago

Also looking for this feature. When you have several groups of columns using the same headerNames, the filter and column visibility menus become a confusing mess.

Hope this gets implemented ASAP, thanks!

subashthiru3 commented 1 month ago

Hi, When I given add filter multiple times in MUI Data grid (and & or) was disabled can explain the reason and if any possible to enable. Note: I'M using data grid Pro version AddFilter

shotokai commented 1 week ago

My team are also Pro users and we really need this. Recently switched from another paid solution where this was a feature.