Launching a function when pressing a button
Launching a function when pressing a button

Hello
I am looking for a way to launch a plugin UI blocker ($.blockUI) when pressing the PDF button and remove it ($.unblockUI) when the pdf file is ready.
Any clue?
Thank you
Radu
This discussion has been closed.
Answers
Hi Radu,
Thanks for the suggestion. Currently, no there isn't a way to do this with Buttons. You'd need to modify the code a little to add suitable events. It does have a
processing
method which is used for each button to indicate that it is doing something, but that isn't presented in a public event or callback.I've added that to the feature list to add!
Regards,
Allan
As I am a novice in JS, even if I'll manage to trap the mousedown on a button, I cannot detect when the processing completes to unblock the UI.
BTW, for a table with 44k recs, the csv file is roughly 24M, and it takes some minutes to complete, but the pdf cannot finish (at least in Chrome), in the end showing "something went wrong"...
Any idea for speeding up the process? and for pdf to complete?
Thank you,
Radu
If you use DataTables 1.10.16 you'll see a bit of a speed up - there is a performance regression in newer versions. However, with that many records it will still take a while to build the file. I'd suggest using a server-side process to do it when you have that many.
Allan
Just to say that the
buttons-processing
event will land in Buttons 1.5.7.Allan