Add event on excelHtml5 button

Add event on excelHtml5 button

credelcredel Posts: 3Questions: 1Answers: 0

Hello everyone,

I need to add a listener to an excelHtml5 button when the action (save file or cancel) is finished.
I use it in an ERP, not in a browser, so I don't have any feature of any browser. just html/javascript .

I found fnComplete :
https://stackoverflow.com/questions/26979826/i-need-an-event-fired-after-successful-export-on-datatables-1-10

but it seems it does not apply to excelHtml5 Button.

I also found a 2016 thread that said this feature may be implemented in the future (don't have the link anymore) ...

Is there any solution or workaround to do this ?

thanks

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,118Questions: 1Answers: 2,583

    Hi @credel ,

    Unfortunately not, it's still in the backlog.

    Cheers,

    Colin

  • allanallan Posts: 61,452Questions: 1Answers: 10,055 Site admin

    This is where any such callback would need to do (JSZip 2.5 probably has a different API for it). So it isn't present at the moment, but could readily be implemented if you want to.

    Allan

  • credelcredel Posts: 3Questions: 1Answers: 0

    Thank you very much for your help.

    I'm a complete beginner in web dev/JS so I have no idea how to implement it. Would you have an example on how to 'add' this event management so I can use it ?

    Does this kind of lines of code would be ok ?

    var event = new Event("FileSaved");
    node.dispatchEvent(event);

  • allanallan Posts: 61,452Questions: 1Answers: 10,055 Site admin
    Answer ✓

    I'd add if ( config.finished ) { config.finished(); } then you can add a finished function to your configuration for the button.

    Allan

  • credelcredel Posts: 3Questions: 1Answers: 0

    Ok thank you

This discussion has been closed.