Buttons for export to Excel do not show
Buttons for export to Excel do not show
Hi!
I need to export my table data to Excel, but with no success whatever I do.
I do not use button styling, just javascripts as follows:
.../js/jquery/jquery.js
...cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js
...cdn.datatables.net/buttons/1.2.2/js/dataTables.buttons.min.js
...cdn.datatables.net/buttons/1.2.2/js/buttons.flash.min.js
...cdn.datatables.net/buttons/1.2.2/js/buttons.html5.min.js
.../js/jszip.min.js
.../js/FileSaver.js
for the ordinary table with common structure in accordance with datatables.net requirements.
My initialisation javascript was taken from this site:
jQuery(document).ready(function() {
var table = jQuery('#Excelex').DataTable( {
buttons: [
{
extend: 'excelHtml5',
text: 'Save current page',
exportOptions: {
modifier: {
page: 'current'
}
}
}
]
} );
} );
Other controls (sorting, info etc.) showing as expected.
What I'm missing to make buttons to show and work?
Answers
Well, I now see that buttons can not be seen unless letter B is set in dom option.
This topic can be deleted.
You can also use the
buttons().container()
method to get the node an insert it into the documentation. The documentation has a section for how to display the buttons.Allan