Author Topic: How to cancel a remote loading?  (Read 2261 times)

rbazua

  • Newbie
  • *
  • Posts: 8
    • View Profile
How to cancel a remote loading?
« on: February 02, 2018, 10:13:29 pm »
I have a remote dataSource for my grid. I want to give my user a "Cancel" button which cancels the current loading of remote data, maybe if the loading is taking too long, or they want to change their searching parameters.
Is there a way I can cancel an ongoing remote loading?
Thanks

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: How to cancel a remote loading?
« Reply #1 on: February 12, 2018, 12:48:20 pm »
jqXHR object returned by $.ajax method has an abort method to cancel the waiting/loading of remote data.

Reference to jqXHR can be obtained in https://paramquery.com/api#option-dataModel-beforeSend callback.

rbazua

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: How to cancel a remote loading?
« Reply #2 on: February 20, 2018, 09:49:18 pm »
Thanks, I was able to implement the functionality I wanted