Download API when using server side processing

Download API when using server side processing

NoBullManNoBullMan Posts: 87Questions: 24Answers: 2

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
I read that when using server side processing, supplied export buttons can only export the current page (whatever is available client side). It also pointed that when using server side processing, I need to download a buttons extension (buttons.download.js). However, the sample uses "api/download" for url and in GitHub, where I downloaded js file, I don't see a download file or folder under api folder.

var table = $('#example').DataTable({
    dom: 'Bfrtip',
    buttons: [
        {
            extend: 'download',
            url: '/api/download'
        }
    ]
});

I could not find any samples or examples of this file online.
Can you point me in the right direction?

Answers

  • allanallan Posts: 64,230Questions: 1Answers: 10,599 Site admin

    I don't see a download file or folder under api folder.

    There isn't one. That is just a placeholder that you would need to replace with whatever location you put your script to generated the download file. The server-side script could create any file type, that would be up to the author of the script and what you need your client to download.

    There isn't an example of the download script I'm afraid.

    The simplest case is that you get all results from a database and create a CSV file from them.

    Allan

  • NoBullManNoBullMan Posts: 87Questions: 24Answers: 2

    Thank you for clarification Allan.

Sign In or Register to comment.