Change Request for Buttons.customize to cancel export on FALSE.

Change Request for Buttons.customize to cancel export on FALSE.

michael_657michael_657 Posts: 5Questions: 3Answers: 0

Request

To be brief, I find it useful to be able to cancel a table export by returning FALSE from the 'customize' callback that can be defined for each button.

This is desired for all of the export button options: csv, excelHtml5, pdfHtml5, print, and, perhaps, copy to clipboard.

Here's the documentation for the excelHtml5 one.
Function call looks like this: config.customize(xlsx, config, dt).

Context

This is mostly useful as this is where I do report validation using the data fed into 'customize' to generate custom reports from the table data. Sometimes the state of the table data is invalid for the selected report and I don't need to continue exporting anymore. Or the changes cause an issue with the export if continued (which likely might've been my fault; got it working before I found out what was going wrong).

I've been manually applying the edit myself due to wanting to take advantage of DataTables' capability to package the table into the export format for me and I've been able to find the five locations in the Buttons code with .customize( to place the edits to make this possible.

Perhaps I'm doing something unrecommended but it's been working well for me.

Answers

  • allanallan Posts: 65,545Questions: 1Answers: 10,891 Site admin

    Hi,

    Yes, I can see it might be useful to have customize return false or something like that to cancel the export. I'll look into implementing that - thanks for the suggestion.

    Allan

Sign In or Register to comment.