Buttons
Buttons

Hello. I hope this is an easy one but it is driving me nuts.
I have a table getting data from a URL to MySql.
This works fine and has a dropdown for number of records per page.
All I want to do is add some export buttons.
When I add buttons they do not show up and I lose the dropdown.
When I remove the URL parameters the buttons show up and work.
An help please?
<script type="text/javascript" language="javascript" >
$(document).ready(function() {
var table = $('#example').DataTable( {
"processing": true,
"serverSide": true,
"ajax":{
url :"employee-grid-data.php", // json datasource
type: "post", // method , by default get
error: function(){ // error handling
$(".example-error").html("");
$("#example").append('<tbody class="example-error"><tr><th colspan="3">No data found in the server</th></tr></tbody>');
$("#example_processing").css("display","none");
}
},
"lengthChange": false,
"buttons": [ 'copy', 'excel', 'pdf', 'colvis' ]
} );
table.buttons().container()
.insertAfter( '#example' );
} );
</script>
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I have kinda worked it out though it took all day. Don't know how to remove my question sorry. JT,
No worries - thanks for posting back. Good to hear you've got it working.
Allan
How did you fix the problem? I'm having the same issue
Are you using the "dom" options?
https://datatables.net/reference/option/dom