jQuery UI Widgets Forums Plugins Data Adapter Cancelling A DataAdapter Send Request

This topic contains 3 replies, has 2 voices, and was last updated by  Main Street James 2 years, 7 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Cancelling A DataAdapter Send Request #96805

    Main Street James
    Participant

    I would like to be able to cancel a DataAdapter send request.

    I am checking for a value in my beforeSend method and under some circumstances I would to cancel the request rather than send it to my server.

    How would I cancel the request?

    Thanks,
    James

    Cancelling A DataAdapter Send Request #96812

    Peter Stoev
    Keymaster

    Hi James,

    We do not have API about that.

    Regards,
    Peter

    Cancelling A DataAdapter Send Request #96814

    Main Street James
    Participant

    Peter,
    Does this mean that if a request starts there is no way to stop it?

    Thanks,
    James

    Cancelling A DataAdapter Send Request #96816

    Main Street James
    Participant

    It turns out that calling jqXHR.abort() in the beforeSend method cancels the jquery ajax request.

    I want to avoid duplicate server requests that do not change the returned data. These duplicate requests can occur when a user presses one of the non-alphanumeric keys on the keyboard (e.g., arrows, page up & dn, Windows or Apple key, etc) or when the current tab loses and regains focus. Calling the jqXHR.abort() method when the current settings.data value is the same as the previous settings.data value prevents these duplicate requests.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.