jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Filtering Questions
Tagged: javascript grid filtering
This topic contains 4 replies, has 2 voices, and was last updated by Peter Stoev 11 years, 11 months ago.
-
AuthorFiltering Questions Posts
-
Hi,
I got 2 questions regarding filtering:
1) Is it possible to apply 2 filtering groups for the same column using the function “addfilter” ?
I’m asking because the name “addfilter” implies that this might be possible, yet when testing this it looks like only that last added filtergroup for a column survives.2) Within a filter group I have filters, each with a filter operator (0 for “and”, 1 for “or”). My question is: how do these get evaluated regarding boolean operator preceedance ? Do you apply the “and”s before you apply the “or”s ? Or dio you apply them in linear sequnce without taking preceedance into account ?
The problem is that I must apply a complex boolean expression to a single column, where I have an expression along the lines of:
(C1 || C2) && (C3 || C4 || C5) && C6My original idea was to put all conditions that must be “OR”ed into groups and then combine the groups using “AND”. Yet it seems like this does not work, on a single column, so I now have to reprogram my algorithm that builds th filtering expression.
Thanks for you help,
StephanHi,
1. Filter Group is a Group of Filters. This means that you can add multiple filters to a Column.
2. Each filter in a filter group is evaluated and then the final result is built by using the comparison operator of each filter.
If you have filters A, B and C in a filter group and the comparison operator of A is “or”. The B and C is “and”, the result will be:“result of A” || “result of B” && “result of C”
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Peter,
Thanks for your reply. In your reply you speak of using a group to apply multiple filters to a column. My question is: can I also add multiple filter groups to one column ?
The advantage to me would be better organization of filters in my software for complex filtering conditions.
Regards,
StephanHi again,
Ok, I made a few tests and they tell me: it is NOT possible to apply TWO filter grousps to ONE column. The second filter group for a column will replace the first.
Since I now know I can not code a complex expression for a single column using filter groups I am now wondering how this can be achieved. Here is my problem:
* lets assume I have 5 filters called A, B, C, X, Y
* what I must achive is the following : (A or B or C) and (X or Y)How can that be achieved using the filtering logic of the grid ? According to boolean algebra the term can be converted into an expression without braces:
“A and X or B and X or C and X or A and Y or B and Y or C and Y”Sadly even the converted expression relies on operator preceedance (ie. ‘and’ must be applied first) and therefore can not be applied to a grid column using your filtering logic … or at least thats how I understand it.
Regards,
StephanHi,
I do not think that your requirement is possible with our built-in Filtering. The filtering works in the way I tried to explain you in the previous post. We will consider extending it in the future.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.