Excel Export button from dataTable using VUEJS

Excel Export button from dataTable using VUEJS

rbbastosrbbastos Posts: 2Questions: 0Answers: 0

Hello,

I am struggling to make an excel export button using the dataTable object within a vue instance. As in the test link below,
I can:
1. make the vuejs display the data from an array in HTML (using a v-for directive). This will be mandatory for me.
2. make the dataTable embed the HTML table with functions such as "sort by", "search", "pagination".

However, I can't make it display the Excel export button.

I appreciate any help. Thanks.

<a class="jsbin-embed" href="http://live.datatables.net/jesepofo/6/embed?html,js,output">DataTables - JS Bin</a>

Replies

  • kthorngrenkthorngren Posts: 12,284Questions: 25Answers: 2,875

    The test case doesn't seem to run and I'm not famliliar with vue but you might need to swap the order of these includes:

        <script src="https://cdn.datatables.net/buttons/1.6.5/js/dataTables.buttons.js"></script>
        <script src="https://nightly.datatables.net/js/jquery.dataTables.js"></script>
    

    I believe dataTables.buttons.js requires jquery.dataTables.js so jquery.dataTables.js needs to be loaded first.

    Kevin

  • rbbastosrbbastos Posts: 2Questions: 0Answers: 0

    Thanks for replying Kevin. I changed the library order and, just for future readers reference, the dataTable call had to be changed from MOUNTED to UPDATED to work properly. Now it is working like a charm.

Sign In or Register to comment.