buttons excel html5 callback

buttons excel html5 callback

jvcunhajvcunha Posts: 81Questions: 10Answers: 1

Hi,
Does html excel buttons have any callbacks?
I would like to put a message when you finish assembling xlsx and download it

Replies

  • allanallan Posts: 61,950Questions: 1Answers: 10,158 Site admin

    It currently only provides the customize and customizeData callbacks.

    Are you finding it takes a long time to generate or something?

    Allan

  • jvcunhajvcunha Posts: 81Questions: 10Answers: 1

    Hi Allan,
    I have a datatable with more than 20 thousand lines and more than 30 columns. Both Excel's generation when printing, take an average of 35 to 40 seconds, freezing the browser

  • jvcunhajvcunha Posts: 81Questions: 10Answers: 1

    Allan,
    The solution I found was to display a message when I clicked the button and, since it freezes everything, it disappears when the file is generated!

    table.button(0).action( function (e, dt, button, config) {
                                table.buttons.info('Mounting EXCEL worksheet', 'Depending on the number of records, it may take a few seconds. Please wait for download ...', 2000);
                                setTimeout(function() { $.fn.dataTable.ext.buttons.excelHtml5.action(e, dt, button, config) }, 1000 );
                            });
    

    The 'settimeout' is necessary because without it, the message only appears during the download

This discussion has been closed.