Export data with Javascript?

Export data with Javascript?

tjohnsontjohnson Posts: 2Questions: 1Answers: 0

Is there a way to call the DataTables export function (Excel, CSV, Copy to clipboard) from Javascript instead of using the buttons?

Answers

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin

    You can use the button().trigger() API method for the Buttons to trigger their actions.

    Worth noting that not all browsers will allow a file to be created and downloaded if it isn't triggered by a user action.

    Allan

  • tjohnsontjohnson Posts: 2Questions: 1Answers: 0
    edited January 2016

    Thanks, that's really helpful!

This discussion has been closed.