Author Topic: Can 02 Filter arrays use mode "OR"?  (Read 1533 times)

atmaneuler

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 33
    • View Profile
Can 02 Filter arrays use mode "OR"?
« on: October 22, 2020, 02:23:31 pm »
I have 2 filterRules arrays:
Code: [Select]
    filterRules1 = [
      { dataIndx: dataIndx_wh, condition: 'great', value: 0 },
      { dataIndx: dataIndx_ass, condition: 'equal', value: 0 },
    ];

    filterRules2 = [
      { dataIndx: dataIndx_ass, condition: 'great', value: 0 },
      { dataIndx: dataIndx_sf, condition: 'equal', value: 0 },
      { dataIndx: dataIndx_sew, condition: 'equal', value: 0 },
    ];

Could I have filter: [filterRules1] OR [filterRules2]??

I try the below code is not work:
Code: [Select]
this.grid.filter({
      oper: 'replace',
      rules: [
        filterRules1,
        filterRules2,
      ],
    });

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 5791
    • View Profile
Re: Can 02 Filter arrays use mode "OR"?
« Reply #1 on: October 23, 2020, 10:26:15 am »
I'm afraid filter API doesn't work this way.

filterRules1 can be applied to one column, filterRules2 to another and then they can be combined with "OR" or "AND"

atmaneuler

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: Can 02 Filter arrays use mode "OR"?
« Reply #2 on: October 23, 2020, 11:36:40 am »
Thank you for reply