Server side processing + CSV request of all data

Server side processing + CSV request of all data

stevetauberstevetauber Posts: 2Questions: 0Answers: 0
edited February 2014 in DataTables 1.10
Hi,

First let me thank you for creating and maintaining such a wonderful project. Currently, I'm running the newest version of DataTables and using Server Side processing. I need to allow for an export of all CSV data. I've read your previous response about this problem here: http://datatables.net/forums/discussion/7757/tabletools-csvexcel-to-get-whole-table-with-serverside/p1

I'm curious if there is a way to do one of the following options:

a) Use the API to extract the request that is normally made to ajax - For example, have datatables build the query string and then return it.
b) Make a request to the Server Side URL as normal but prevent the existing table from clearing itself or throwing an error if no response returns, essentially make a one way request.

Essentially what I'd love to do is resend the exact same request that was last made except append `?format=csv`.

Thanks for any insight you can provide.

Replies

  • stevetauberstevetauber Posts: 2Questions: 0Answers: 0
    edited March 2014
    Any idea on this? Seems like just a spam post above.

    *edited by Allan* - It was spam - now deleted
  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    > a) Use the API to extract the request that is normally made to ajax - For example, have datatables build the query string and then return it.

    This is actually high up on my to do list for DataTables 1.10 - an `ajax.params()` method. At the moment you would need to do something like the download plug-ins here: http://datatables.net/extras/tabletools/plug-ins .

    > b) Make a request to the Server Side URL as normal but prevent the existing table from clearing itself or throwing an error if no response returns, essentially make a one way request.

    Not within DataTables, but if you have the parameters (as `a` above) then you wouldn't need DataTables to make the request I guess.

    Allan
  • stevetauberstevetauber Posts: 2Questions: 0Answers: 0
    Okay thanks. I look forward to the params method being implemented.
  • jolyon2000jolyon2000 Posts: 12Questions: 0Answers: 0
    I'm voting the need for the param() method - desperately in need of the ability to tack-on parameters to the server call in order to allow the server-side to do the filtering. Any alternatives in the mean time?
  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    The `ajax.params()` method is now available in the nightly. Documentation here: http://next.datatables.net/reference/api/ajax.params()

    @jolyon2000

    > desperately in need of the ability to tack-on parameters to the server call in order to allow the server-side to do the filtering

    Use `ajax.data` ( http://next.datatables.net/reference/option/ajax.data ) to send additional data to the server - not this new API method.

    Allan
This discussion has been closed.