Button to Downloads PDFs as zipped file

Button to Downloads PDFs as zipped file

anasazanasaz Posts: 4Questions: 2Answers: 0

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
Hi,
I would like to add a new button called "Download Applications". the button then will return a list of all filtered rows.
each row has a field called application (which is the path of a PDF e.g. ./applications/applicant_1.pdf).
When the user click on the download button, it will fire a script which will get the list of all PDFs and then add them to a zip file and make them available to download.

All what I'm looking for is how to add a button that can pass an array of all selected rows (with that one particular field which has the path to the PDF)

Really appreciate your help and time. Thank you very much!

Answers

  • kthorngrenkthorngren Posts: 21,443Questions: 26Answers: 4,974

    You can create a custom button, see this example. You can get the selected rows using the steps in this example. Use the rows().every() with the selector modifier { selected: true }, as shown in the example, to loop all. the selected rows to build an array of the PDF paths.

    Kevin

Sign In or Register to comment.