Is it possible to load the config of datatables async?
Is it possible to load the config of datatables async?
![Xeli](https://secure.gravatar.com/avatar/e9a50cfb6dd20efd1198fdafc0b1c11a/?default=https%3A%2F%2Fvanillicon.com%2Fe9a50cfb6dd20efd1198fdafc0b1c11a_200.png&rating=g&size=120)
Looking at this example: http://datatables.net/reference/option/stateLoadCallback
It shows how to get the config via a synchronous ajax call. However newer versions of firefox do not support this. Is there a way to load it asynchonically?
Ideally you'd either have to accept a promise as return value, or provide a callback like fnServerData option has.
Thanks!
This discussion has been closed.
Answers
I am in the same boat. Chrome still allows it, but throws this warning:
Section 4.5.1 of the XHR spec gives the following message:
While there are possible workarounds for this, hopefully this will be supported down the road as browsers phase this out.
I've just seen that message pop up in Chrome in the last few days as well. I hadn't been aware that async was going to be deprecated, but I'd say that is fair enough, it isn't an ideal solution.
At the moment the only other option is to use the API to load in the state information - for example
page()
to set the paging, etc. I will look at adding a method that will accept a DataTables state saved object to restore a saved state - probably as a plug-in initially.Allan