Button Extensions not showing up
Button Extensions not showing up
dhookway
Posts: 4Questions: 1Answers: 0
I created a JS fiddle to show this: https://jsfiddle.net/q0ruv6sx/2/
I am instantiating this by the following code:
ThisDataTable = $('#MyTable').DataTable({
data: TableData,
buttons: [
{
extend: 'pdfHtml5',
download: 'open'
},
'print'
],
columns: [
{ title: "Number" },
{ title: "Name" },
{ title: "Start Date" },
{ title: "Customer" },
{ title: "Location" },
{ title: "Sales Person" }
]
});
I have tried without the pdfHtml5 button as well.
I am including all of the recommended JS and CSS from the download tool provided.
This question has accepted answers - jump to:
This discussion has been closed.
Answers
You need to add the
dom
option to include the buttons (B
). This is an example:https://datatables.net/extensions/buttons/examples/initialisation/simple.html
Kevin
As soon as I did that, the "number of records to display" dropdown disappeared. Is there an option I have to set for that?
From the dom documentation:
l - length changing input control
Ok, I think one last question.
I have
as my DOM options. The buttons and length dropdown aren't showing up on the same line.
They should with that. Can you give a link to a test case showing the issue please?
Allan
ended up going with
as my full initialization code.
I needed to do some work with bootstrap to make it appear how I wanted
Yup - if you are using Bootstrap the
dom
option is a total pig. I'll fix that in 2018 .Allan