Show a "working spinner" on pdfHtml5 during generation

Show a "working spinner" on pdfHtml5 during generation

cirexcirex Posts: 1Questions: 1Answers: 0

Are there any callbacks to be notified when the PDF generation has started and ended? I have a table with 3,000+ rows and it takes a few moments for the PDF to start generation and the tab is frozen.

I'd like to show a spinner or some model to let the user know it is working.

    $(document).ready( function () {
        tableData.DataTable({
            buttons: [
                {
                    extend: 'pdfHtml5',
                    orientation: 'landscape',
                    pageSize: 'A4',
                    alignment: "center",
                    title: "{{report_name}}",
                    customize : function(doc) {
                                    //showWorking();

                        doc.pageMargins = [10, 10, 10,10 ];
                        doc.content[2].table.widths = Array(doc.content[2].table.body[0].length + 1).join('*').split('');
                    },
                }

            ],
            aLengthMenu: [
                [25, 50, 100, 200, -1],
                [25, 50, 100, 200, "All"]
            ],
            iDisplayLength: -1
        })
    } );

I found this from 2016 but I don't think it works. https://datatables.net/forums/discussion/33270/is-it-possible-to-show-a-spinner-while-a-pdf-is-created-with-pdfhtml5

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @cirex ,

    I suspect the same still applies - so that should still work. What happens when you try it?

    Cheers,

    Colin

This discussion has been closed.