Author Topic: remote filter listener is not working  (Read 3586 times)

gtwangi

  • Newbie
  • *
  • Posts: 9
    • View Profile
remote filter listener is not working
« on: December 17, 2018, 07:17:33 pm »
I am using pqgrid v5.5 and chrome.
I expect that when filter option is selected, the listener function is called.
but 'change' listener is not firering.
what am I missing?

{
    dataIndx: "TmpltNm",
    title: "Template",
    filter: {
       crules:[{condition:'equal'}],
       options : app.sheet.getFilterOptions("TMPLT_NM")
       listener : {
         change : function(ui, evt){
         ...
        }
    }
}

}

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: remote filter listener is not working
« Reply #1 on: December 17, 2018, 07:59:41 pm »
Yes listener is supposed to fire as per docs but it's not.

Anyway it's not required for remote filtering for > v5.2 as grid calls the filter method internally.

https://paramquery.com/pro/demos/filter_header  ( listener not used anywhere )


gtwangi

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: remote filter listener is not working
« Reply #2 on: December 17, 2018, 08:30:37 pm »
I use both infinite scrolling and remote filter on the same page.
so I think that I need to clear grid data after filter is selected. otherwise unfiltered data remain in grid.
this works well on free version.(v2.4.1)
How could I use listener for remote filter as free version? or Is there alternative ways?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: remote filter listener is not working
« Reply #3 on: December 18, 2018, 03:39:48 pm »
That's a good point but beforeFilter event takes care of resetting the data cache

Code: [Select]
beforeFilter: function(){
    pqIS.init();
},

in this example of infinite scrolling: https://paramquery.com/pro/demos/infinite_scroll

So filter.listener is dispensable.

gtwangi

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: remote filter listener is not working
« Reply #4 on: December 18, 2018, 03:51:50 pm »
I resolved that.  :)
thank you!!!