No button appears
No button appears

Hi All,
I have a quite simple setup: datatables, buttons a language pack and their css files are loaded from cdn (checked, they are loaded). Then I initialize like this:
$(document).ready( function () {
$('#people').DataTable( {
buttons: [
'copy', 'excel', 'pdf'
],
"language": {
"url": "//cdn.datatables.net/plug-ins/1.10.19/i18n/Hungarian.json"
}
});
$.fn.dataTable.ext.order.intl( 'hu' );
});
On load DT works perfectly except that there are no buttons nor any error message on the console. It doesn't matter if I use the dom option or not.
Any idea what went wrong?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi @hellsing ,
You need to modify
dom
to include the buttons - see the example here.Cheers,
Colin
Hi Colin,
I already tried both dom: 'Bfrtip' and 'B<"clear">lfrtip' but they don't make any change.
Thanks,
h.
Hi @hellsing ,
Have you also included the necessary JS and CSS files - you see those on the examples here.
If still no joy, we're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
Hi @colin,
Yes, everything is included and loaded (checked twice). I'm on localhost but will figure out how to make it accessible.
Thanks,
hellsing
It might be easier to build up a test case to show the issue than to try making your localhost code available. Since the problem is not reliant on your specific data you can use simulated data.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
You're absolutely right
Here we go. I made a table with fake data. DT works but no export buttons appear.
Thanks of dealing with it.
I just realized live.datatables.net uses jQuery 1.11.3 and I'm on 3.1.1. Is this causing the error? I don't have any error msg on console.
Datatables suppots jQuery 1.7 and new according to this doc:
https://datatables.net/manual/installation#Dependencies
The problem is you didn't include the buttons JS and CSS files. I updated your example to include the necessary files and now it works:
http://live.datatables.net/botuwaku/2/edit
This page describes the requirements:
https://datatables.net/extensions/buttons/
The Download builder can be used to obtain the needed files for buttons or any other extension.
Kevin
[user slaps his forehead and feels himself utterly idiot]
Thanks