Author Topic: Remote filter textbox listeners: ['change'] not working  (Read 3718 times)

TonyLeech

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 76
    • View Profile
Remote filter textbox listeners: ['change'] not working
« on: September 16, 2015, 02:16:24 pm »
I'm using several textbox filters and dropdown filters following the remote filter demo.  The dropdown filter works fine with listeners ['change'], but I can only get the textbox to work with ['keyup'] listener.  If I use the ['change'] listener on the textbox then it is only actioned once I click on another textbox in a different header.

In your demo the ['change'] listener seems to work after pressing the Enter key, mine is not triggered by the Enter key.  What do you think I might have missed?

Just to clarify - with the ['keyup'] listener on the textbox each keypress returns an updated filter from the database.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6255
    • View Profile
Re: Remote filter textbox listeners: ['change'] not working
« Reply #1 on: September 16, 2015, 02:47:01 pm »
That is due to browser difference. You might have checked demo in Chrome/ FF while your example in IE.

change event is fired in IE when the textbox loses focus by tab or clicking on another control.

Custom listener can also be written as per the needs, you could use a setTimeout function in keyup to throttle the server requests.

Example for writing a custom listener: http://paramquery.com/pro/demos/filter_date
« Last Edit: September 16, 2015, 03:30:00 pm by paramquery »

TonyLeech

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 76
    • View Profile
Re: Remote filter textbox listeners: ['change'] not working
« Reply #2 on: September 16, 2015, 03:59:20 pm »
Thank you.  Yes you are exactly right - browser difference.  I was indeed checking the demo in chrome and my work in IE.  I'll check out your custom listener suggestion.  Thanks again.