gyrocode / jquery-datatables-checkboxes

Checkboxes is an extension for the jQuery DataTables library that provides universal solution for working with checkboxes in a table.
https://www.gyrocode.com/projects/jquery-datatables-checkboxes/
MIT License
150 stars 61 forks source link

DataTables button not showing when using this plugin #113

Closed kcastro18 closed 4 years ago

kcastro18 commented 4 years ago

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.

mpryvkin commented 4 years ago

Can you please show your DataTables initialization options?

kcastro18 commented 4 years ago

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' }
],
});

mpryvkin commented 4 years ago

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?

kcastro18 commented 4 years ago

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!

image

lenamtl commented 4 years ago

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 ...