Launching a function when pressing a button

Launching a function when pressing a button

raduborcanraduborcan Posts: 20Questions: 3Answers: 0

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

Answers

  • allanallan Posts: 61,710Questions: 1Answers: 10,103 Site admin

    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

  • raduborcanraduborcan Posts: 20Questions: 3Answers: 0

    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

  • allanallan Posts: 61,710Questions: 1Answers: 10,103 Site admin

    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

  • allanallan Posts: 61,710Questions: 1Answers: 10,103 Site admin

    Just to say that the buttons-processing event will land in Buttons 1.5.7.

    Allan

This discussion has been closed.