two inputs controlling filtering of one column
two inputs controlling filtering of one column
I am doing some custom filtering. I have a checkbox, and a select dropdown.
The checkbox filter i was running filters using a regex saying "give me everything BUT foo"
The select dropdown has "foo" as a selection, and it is set to filter the same column.
The problem im having is both are working independantly, and not together.
If i have the checkbox to hide foo, then select foo in the dropdown, the foo records show.
I need to figure out how to make them work together so it will take into consideration what each form field is doing.
Ive looked at doing a custom filter, but I dont see a lot of examples on how to do it, or how to do it in my use case.
Any help is greatly appreciated
-Matthew
The checkbox filter i was running filters using a regex saying "give me everything BUT foo"
The select dropdown has "foo" as a selection, and it is set to filter the same column.
The problem im having is both are working independantly, and not together.
If i have the checkbox to hide foo, then select foo in the dropdown, the foo records show.
I need to figure out how to make them work together so it will take into consideration what each form field is doing.
Ive looked at doing a custom filter, but I dont see a lot of examples on how to do it, or how to do it in my use case.
Any help is greatly appreciated
-Matthew
This discussion has been closed.
Replies
I think the answer to your question probably lies in what you want to happen when 'not foo' is selected at the same time as 'foo'.
I'd suggest there are two options:
1. Combine the two values together whenever either one changes, and apply the result to fnFilter. This way you can control it perfectly, and possibly add notification that the input is invalid.
2. Do custom filtering as you suggest (also as you suggest, there is only really one example of that at the moment, plus the development documentation). But how that would work depends on the behaviour you want.
Allan
I'm was having a problem writing that.
How do you suggest combining values?
Allan
-matthew
Allan
I sent you a simple example of what i was trying to do to your email. I made a demo table and form fields etc.
Shows them working independantly, but Im still needing to figure out how to make them work together.