Filter by Condition not working for multi-select in wijmo grid

Posted by: technical.store.technical on 14 June 2021, 11:18 pm EST

    • Post Options:
    • Link

    Posted 14 June 2021, 11:18 pm EST

    Hi,

    If I apply filter by condition and try to filter using " Equals " and text as “maths” then it is not filtering the list.

    Snippet -

    https://stackblitz.com/edit/angular-8dl1rv?file=src/app/app.component.ts

    Please provide solution.

    Thank you.

  • Posted 15 June 2021, 5:38 pm EST

    Hi team,

    Can you please provide solution.

    Thank you.

  • Posted 16 June 2021, 3:38 am EST

    Hi,

    The above filtering is not working for Subject column and SubSubjects column as the cells in those column contains data in the form of Array. the FlexGridFilter normally accepts String/Number dataType of the cell to perform filtering operation, To enable the same for complex data types such as Objects, Arrays. we may override the default filtering mechanism and provide custom filter implementation for certain columns and allow default filtering for rest of the columns.

    Please refer to the sample below which demonstrates how we could implement custom filtering for FlexGridFilter:

    https://stackblitz.com/edit/angular-ousgvq?file=src%2Fapp%2Fapp.component.ts

    ~sharad

  • Posted 16 June 2021, 10:12 pm EST

    Hi Sharad,

    If In column subjects i try to apply filter by condition ( equals to maths) then it is also filtering ‘ALL’ values (as it contains maths in it too). The ‘ALL’ value should not get filtered as maths value is not present on the UI.

    Snippet of the above example -

    https://stackblitz.com/edit/angular-ousgvq?file=src/app/app.component.ts

    Also, when we apply filter by condition it clears the table for fraction of seconds. How can we stop this behavior. It should look smooth like Filter by value. This issue is easily reproducible if we have 7-8k amount of data.

    Please provide solution.

    Thank You.

  • Posted 20 June 2021, 4:40 pm EST

    Hi team,

    Can you please help us with the solution.

    Regards,

  • Posted 20 June 2021, 10:47 pm EST

    Hi,

    All in the sample is displayed because all means that maths is selected too so underlying value contains maths too. Further, if you do need to skip all from the filter test then you customize the filter condition accordingly. I’ve update the previously shared sample to reflect this change. Please refer to the following sample which demonstrates the same:

    https://stackblitz.com/edit/angular-cgursq?file=src/app/app.component.ts

    In the shared sample, you may update the passesCustomColFilter method to apply custom filter according to your requirement.

    Further, regarding the performance issue in case of condition filter, this is expected because condition filter is no longer a simple filter just like value filter, in condition filter, for multiselect data we need to loop each selected item and check the filter for that filter so as the no of selected values increses, time required to check all the values is also expected to grow.

    Regards

  • Posted 22 June 2021, 4:27 pm EST

    Hi Sharad,

    the above solution is not working for the subsubejcts column. I still can see the ‘ALL’ is getting displayed when i apply filter for ‘1’ by using filter by condition.

    https://stackblitz.com/edit/angular-ygulbt?file=src/app/app.component.ts.

    Also, for the performance issue for filter by condition on object, Do you have some loader to display?

    Can you please provide solution.

    Regards,

  • Posted 23 June 2021, 8:59 pm EST

    Hi team,

    Can you please provide solution for this.

    Thank you.

  • Posted 24 June 2021, 8:56 pm EST

    Hi team,

    Can you please provide solution.

    Thank you.

  • Posted 27 June 2021, 4:59 pm EST

    Hi team,

    Can you please provide solution.

    Thank you.

  • Posted 28 June 2021, 12:03 am EST

    Hi,

    The issue in the sample was arising due to a bug in the code, at line #188, it needs to be this.getSubSubjects() whereas this.getSubjects() was used, I’ve updated the sample, you may refer to the following sample:

    https://stackblitz.com/edit/angular-hrd1bc?file=src/app/app.component.ts

    Regards

  • Posted 28 June 2021, 3:24 pm EST

    Hi Sharad,

    1. In above Snippet, you have removed our requirement of showing ‘ALL’ value if i select value ‘ALL’ in previous column ( ‘Subjects’).

    I’ve updated the sample according to our needs and the issue still persists.

    https://stackblitz.com/edit/angular-re5uf1?file=src/app/app.component.ts

    1. There is one more issue in filter by condition. If I apply filter in subjects as " equals Maths and Equals Chemistry" it gives zero result even though we have data.

    Can you please above solution with above changes itself.

    Thank You.

  • Posted 29 June 2021, 7:07 pm EST - Updated 3 October 2022, 4:30 am EST

    Hi,

    1). I checked the previously shared sample but All functionality seems to be working fine. I’ve attached a gif of our observation, please refer to the same and let me if I’m missing something.



    2). I’ve updated the sample to fix the issue, please refer to the following sample:

    https://stackblitz.com/edit/angular-qcyw6n?file=src/app/app.component.ts

    Regards

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels