jQWidgets Forums

jQuery UI Widgets Forums Grid Filtering Questions

This topic contains 4 replies, has 2 voices, and was last updated by  Peter Stoev 11 years, 11 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Filtering Questions #24732

    stephan
    Participant

    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) && C6

    My 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,
    Stephan

    Filtering Questions #24750

    Peter Stoev
    Keymaster

    Hi,

    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 Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Filtering Questions #24755

    stephan
    Participant

    Hi 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,
    Stephan

    Filtering Questions #24781

    stephan
    Participant

    Hi 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,
    Stephan

    Filtering Questions #24796

    Peter Stoev
    Keymaster

    Hi,

    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 Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.