Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82672

Buttons extension installed, get nothing but empty div

$
0
0

Hi all, I am stumped on trying to use the Buttons extension from https://datatables.net/extensions/buttons/

Here is my setup. I have installed it by npm, and my html is sourcing these datatables related files, in this order:

datatables.net-bs/css/dataTables.bootstrap.css
datatables.net-buttons-bs/css/buttons.bootstrap.css

datatables.net/js/jquery.dataTables.js
datatables.net-bs/js/dataTables.bootstrap.js
datatables.net-buttons/js/dataTables.buttons.js
datatables.net-buttons-bs/js/buttons.bootstrap.js

I have tried all of the various methods to instantiate the buttons as described in the https://datatables.net/extensions/buttons/
What I see is an empty div gets created, with no buttons:

<div class="dt-buttons btn-group"></div>

Here is my current method of instantiating:

let table = $(this.table).DataTable(this.datatableOpts());
let buttons = new $.fn.dataTable.Buttons( table, {
    buttons: [ 'copy', 'csv', 'excel', 'pdf']
});
buttons.container().appendTo($(this.tableButtons));

Please let me know any suggestions or what I am overlooking. Thanks so much!


Viewing all articles
Browse latest Browse all 82672

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>