processing phase...

processing phase...

luisrortegaluisrortega Posts: 79Questions: 6Answers: 1

How can I know if the dataTable object is waiting for server data?

I have a timer refreshing the data every so often, if the server happens to be busy, I don't want my code to call another reload.

Visually I see the processing popup, however programmatically I'm not sure how to validate so before calling reload again!

Tks,
Luis

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Hi Luis,

    There isn't an API method you can query to determine if there is an Ajax request going on, but what you could do is listen for preXhr and xhr. Set a flag in preXhr which you can check - if it is true then there is an Ajax request in progress, then clear the flag in xhr.

    Allan

This discussion has been closed.