Export to Excel Button: is it any event refered to the END of the action?
Export to Excel Button: is it any event refered to the END of the action?
Hi all,
I'm using the built-in button File export - Excel HTML5 (https://datatables.net/reference/button/excelHtml5) to provide the ability to export the current datatable to Excel. What I'm seeing is that, when the dataset is large, this process (since you click the 'export' button until the file starts downloading) can take several seconds, and the screen is 'frozen' until the download starts, so the user can't perform any action. Ideally, I would like to show a 'spinner/loading' during this process (as it's not asynchronous) and hide it when the download starts, but I can find anywhere in the documentation (https://datatables.net/reference/api/#buttons / https://datatables.net/reference/option/#buttons) if there is any event in the plugin where I can attach this action.
I've only seen this action: https://datatables.net/reference/option/buttons.buttons.action but this is fired when the button is clicked and the action starts. Also found this: https://datatables.net/reference/api/%24.fn.dataTable.fileSave() but it refers to the FileSaver.js documentation, and there I can't find any event related to the 'end' of the action.
Any help or guideline about this would be highly appreciated.
Thanks in advance,
Answers
I was looking for something like this as well.
With large datasets and customization of cells it can take quite a few seconds to create the file. (Especially in IE)
It would be nice to have the default processing indicator during the process to have some feedback for the user.
Is there anything available for start and complete event?
Currently no - sorry. It is however something that is on my radar and I'll be adding such events to all buttons in future. I can't say when exactly yet since I've got a fairly significant backlog, but I am aware of this issue!
Allan
Hi Allan. Do you already have the solution to this issue?. Thanks!
Hi @jccampoh ,
No, it's still the same state, I'm afraid.
Cheers,
Colin