Stop the request on "preXhr.dt" (not on "preDrawCallback")
Stop the request on "preXhr.dt" (not on "preDrawCallback")
Good day!
I'm creating now a server-side export button.
I want ot modify the request, which is sent to server in preXhr.dt
event.
E.g. I will clear the filters if I need to export the entire data without filters.
The basic concept:
1. click custom button, and set params for the export (e.g. all table OR current page), trigger fn.Draw()
.
2. On preXhr.dt
check if any params are set, then we are exporting something, not just doing usual actions. If so, stop drawing
.
Is it possible to do?
This question has an accepted answers - jump to answer
Answers
You could use
preDrawCallback
(notpreXhr
- it doesn't have a cancel option). But I wouldn't recommend it. Just don't request the draw if you don't want it to draw.Allan
Aha. Can you please tell me then, how do I get the same object as in
preXhr
event, which has all the details of the request being prepared?There is no option for that I'm afraid - sorry. As I say, the best thing to do is not to make the request in the first place.
Allan
Okay, thanks, allan!