DataTables / Vue Exporting Buttons

DataTables / Vue Exporting Buttons

abdosaeedabdosaeed Posts: 12Questions: 2Answers: 0

Hi, is there a complete example that include using exporting buttons (excel,pdf,..).
thank you for great vue package

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Answer ✓

    Hi Chris,

    Sure, here you go.

    The key for the Excel export is to include JSZip and for the PDF export add pdfmake:

    import jszip from 'jszip';
    import pdfmake from 'pdfmake';
    
    DataTablesLib.Buttons.jszip(jszip);
    DataTablesLib.Buttons.pdfMake(pdfmake);
    

    Allan

  • abdosaeedabdosaeed Posts: 12Questions: 2Answers: 0

    Thank you @allan that what i am looking for

  • jrsfjrsf Posts: 1Questions: 0Answers: 0

    When I try to set up the buttons extension using this as a template, I get a ReferenceError:

    Uncaught ReferenceError: jQuery is not defined
        at buttons.dataTables.mjs:37:12
        at buttons.dataTables.mjs:39:1
    

    If I don't import the modules required for the buttons, the table displays and works as expected. I just get the ReferenceError when I try to import the buttons.

    Am I missing anything? Do I need to import anything else in the App that is not displayed in this example?

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    The example I linked to appears to work okay. Can you link to a page showing the issue please?

    Thanks,
    Allan

Sign In or Register to comment.