Author Topic: mode change not working "OR" and "AND"  (Read 1578 times)

sshede

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 41
    • View Profile
mode change not working "OR" and "AND"
« on: December 23, 2020, 05:21:59 pm »
Hi,

I tryed your example but not working mode change.

I have below changes in your exmplae - "Local header filtering".
 1) Add html part

<select id="andOrFunc"><option>Select Mode</option><option value="OR">OR</option><option value="AND">AND</option></select>

2) javascript

$(document).on("change","#andOrFunc", function(){
         var grid=$grid.pqGrid("getInstance").grid;
         grid.filter({ oper: 'replace', on: true, mode:"OR" });
      })



paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6210
    • View Profile
Re: mode change not working "OR" and "AND"
« Reply #1 on: December 24, 2020, 10:00:14 am »
Code: [Select]
$("#andOrFunc").on('change', function(evt){
       var mode = $(evt.target).val();
       grid.option('filterModel.mode', mode);
      grid.filter({ mode: mode  });
    })

Please check this jsfiddle.

https://jsfiddle.net/myzqugvn/