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

Change filter logic from AND to OR #3063

Closed
2 of 4 tasks
nikitxskv opened this issue Aug 27, 2020 · 4 comments
Closed
2 of 4 tasks

Change filter logic from AND to OR #3063

nikitxskv opened this issue Aug 27, 2020 · 4 comments
Labels
duplicate Grid The DevExtreme Reactive Grid component

Comments

@nikitxskv
Copy link

  • I have searched this repository's issues and believe that this is not a duplicate.

I'm using ...

  • React Grid
  • React Chart
  • React Scheduler

Description

Hi!

I want to change filter logic from AND to OR.
Suppose that I have table with two columns:

Name | Age
----------
Ivan |  21
Nick |  23
Alex |  17

Now if I set first column filter with Ivan value and second column filter with 23 value I'll got empty table. But I want to get table with two rows:

Name | Age
----------
Ivan |  21
Nick |  23

Could you tell how to do this, please?

@AryamnovEugeniy AryamnovEugeniy added duplicate Grid The DevExtreme Reactive Grid component labels Aug 28, 2020
@AryamnovEugeniy
Copy link
Contributor

Hi!

We have already registered a similar issue: #2686. Please, refer to it.

If you have any other questions, we will be happy to assist you.

@nikitxskv
Copy link
Author

Thank you very much!

@nikitxskv
Copy link
Author

nikitxskv commented Aug 28, 2020

And what if I want to create more complicated filter? For example:
firstColumn == 'Nick' && (secondColumn == 4 || thirdColumn == 'Apple')
How can I do this?
@AryamnovEugeniy

@AryamnovEugeniy
Copy link
Contributor

You can update filterExpression getter as i've done in this example: https://codesandbox.io/s/adoring-meitner-4sedo. I created a complex filter out of name, gender and city columns
Note, that this example only illustrates the approach, it may in several cases, for example, when a filter value is not provided for one of the columns I mentioned above. It is necessary to add logic that processes cases when, for example, one of the filters is empty. But approach will remain the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Grid The DevExtreme Reactive Grid component
Projects
None yet
Development

No branches or pull requests

2 participants