Unable to display buttons
Unable to display buttons
Attempting to use the Buttons extension, and not able to display the buttons, as per the documentation.
I've tried each of the methods, yet they are not showing.
Can you review my js on http://live.datatables.net/sojeluju/1/
Help show me what I'm missing.
$(document).ready( function () {
var table = $('#example').DataTable({
"sPaginationType" : "full_numbers",
"ajax": "/examples/server_side/scripts/server_processing.php",
"processing" : true,
"serverSide" : true,
"fixedHeader" : true,
"lengthMenu" : [[10, 25, 50, 100, 200, -1],[10,25,50,100, 200, "All"]],
"pageLength" : 25,
"sScrollX" : "110%",
"sScrollY" : "600px",
"bScrollCollapse": true,
"columnDefs": [
{ "type": "signed-num", "targets": 3}
],
dom: 'Bfrtip',
buttons: ['copy','excel','print']
});
$('#example tfoot th').each(function() {
var title = $('#example thead th').eq($(this).index()).text();
console.log(title);
$(this).html('<input type="text" placeholder="Search ' + title + '"/>');
});
table.columns().every(function () {
var datatableColumn = this;
$(this.footer()).find('input').on('keyup change', function() {
datatableColumn.search(this.value).draw();
});
});
} );
Thank you,
Allan
This question has an accepted answers - jump to answer
Answers
Sort out your js loading sequence. jQuery first, then DataTables, then DataTables' Buttons.
Thanks, I didn't check this in the example. However, it didn't make a difference.
Try adding these scripts:
Kevin
Still encountering issues getting the buttons to display. I'm certain I'm doing something incorrectly. I'll go back over the docs and my code.
Allan
I'd suggest using the download builder to make sure you get all the right files and in the right order.
Allan
Thank you