Custom server side requests

Custom server side requests

peipstpeipst Posts: 7Questions: 0Answers: 0
edited April 2013 in General
Hi,

I'm using DataTables with server-side processing, I want to export the current list of entries (all sites, which the client doesn't see at this moment) by generating a csv file and offering it for download. Exported entries should be the same as the DataTable shows, e.g. same sorting, filtering, etc. On the api-side I would need all the parameters of the DataTable like they are sent on initialization or on fnDraw(). Is there a way to double this request, so I can just add another GET-parameter to it and let it return the csv file for download?

PS: I'm using DataTables 1.9.4 and jQuery 1.9.1

Kind regards peipst

Replies

  • peipstpeipst Posts: 7Questions: 0Answers: 0
    I've solved the problem myself. My export button adds another GET-Parameter (e.g export=true) to the URI and refreshes the DataTable (and remove the parameter right after that), in the meantime the api creates my file (it searches for an export parameter) and gives back information on how to download the file (download session inside my framework). In the fnDrawCallback I've added a checking procedure for the custom response key inside the JSON object from the api to link the download session to the user and access it.
This discussion has been closed.