Automatic download of table from summary page

Automatic download of table from summary page

saadaansaadaan Posts: 2Questions: 1Answers: 0

Hi,

So I have a list of items which I show on a summary page. Each item is clickable, and when clicked, its details are opened on a separate page in a datatable, and I am giving the button of excel download on top of table. What I want to do is to give a DOWNLOAD button on the items summary page outside, which when clicked should download the detail of that item. Please note that I am trying to avoid opening the item details page, since there are a lot of them, and its a hassle opening all one by one just to download excel file.

2 possible options I am looking for:

  • Any option to download the content of the datatable from the main summary page. without actually opening the page (its a bit weird, I know)
  • If not, any option of opening a temporary item details page, populating the DT, triggering the automatic file download, and then page gets closed automatically (not depending on user action for closing).

Thanks,
Saad

Replies

  • kthorngrenkthorngren Posts: 21,299Questions: 26Answers: 4,945

    You will need the Datatable information available for the Datatables export buttons to work. They export the data that is available in the client. Maybe you can hide the Datatable or put it in a tab. Then you can use the Buttons trigger API to export the data programatically:
    https://datatables.net/reference/api/button().trigger()

    HTH,
    Kevin

This discussion has been closed.