JavaScript UI Libraries & Blazor Components Suite – Smart UI Forums Table Table “and” Filters not working

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #102889
    nitroplonker
    Participant

    The issue I am having is that when the filters are run the table always treats the condition as ‘or’ between the columns when it is set to ‘and’.

    Here is an example of what is always being treated as ‘or’

     const filterGroup1 = new w.Smart.Utilities.FilterGroup();
    const filterObject1: object = filterGroup1.createFilter('string', 'x', 'CONTAINS');
    filterGroup1.addFilter('and', filterObject1);
    this.table.addFilter("ContactName", filterGroup1);
    
    const filterGroup2 = new w.Smart.Utilities.FilterGroup();
    const filterObject2: object = filterGroup2.createFilter('string', 'm', 'CONTAINS');
    filterGroup2.addFilter('and', filterObject2);
    this.table.addFilter('CustomerID', filterGroup2);
    

    This results in rows being returned if they match either condition of:

    “Contact Name” containing X”

    or

    “CustomerID” containing “M”.

    What I want is for only rows that match both conditions to be returned

    #102892
    admin
    Keymaster

    Hi,

    At present, filters with addFilter are using ‘or’ between the different filter groups in the Table. We will add an option in a further version to set it to ‘and’, too.

    Best regards,
    Peter Stoev

    Smart UI Team
    https://www.htmlelements.com/

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.