Closed kcastro18 closed 4 years ago
Can you please show your DataTables initialization options?
var table = $('#tblData').DataTable({
"ajax": {
"url": "SomeURL",
},
"columnDefs": [
{
"targets": 0,
"checkboxes": {
'selectRow': true,
'selectAllPages': false,
'selectAllRender': ''
}
},
{ "targets": [5, 6, 7, 8, 9], "visible": false },
{ "targets": 1, "width": "15%" }
],
order: [[1, "asc"]],
destroy: true,
dom: 'Bfrtip',
buttons: [
{
extend: 'excelHtml5',
title: 'All Data'
}
],
});
Sorry, I could not replicate the issue. Please see Buttons extension example with default options and example with options similar to yours. Are you able to demonstrate the problem using one of these examples as a starting point?
Hi,
I did copy the code with the default options and the buttons are still not showing(refer to the image below). I even use the sample data on your example to make sure it is exactly the same. My whole project also use jquery.dataTables.js and dataTables.bootstrap.js, do you think that matters?
Please let me know.
Thank you!
Hi,
Which Datatables version are you using? I saw an issue about buttons recently.
If you right click / inspect using Chrome do you have any JS error into the console?
Also make sure you have all button scripts and CSS url / link loaded. The links order are important too and must be after datatables.js one.
I'm using Datatables with Bootstrap with no problem.
To investigate I would do a basic table without ajax and check if this is working ok then I would make a more complex table using Ajax ...
The plugin seems to have conflict with datatable buttons.
I've been trying to figure why the excel export button on my datatable is not showing and I tried changing the buttons to other ones like pdf or copy and non of then were showing. I did a lot of troubleshooting to figure out one is wrong, my datatable codes looks correct and everything else are working. So then I thought of maybe this plugin is causing the buttons not show up so I tried removing it and sure enough the buttons showed up.
I hope this get fixed. I really like this plugin and I'm hoping I can continue using this without it causing problems.
If you have suggestion for a workaround I will greatly appreciate it.
Thank you.