Cannot reinitialise DataTable when adding new script
Cannot reinitialise DataTable when adding new script
Muiter
Posts: 4Questions: 3Answers: 0
I am getting the message
DataTables warning: table id=dataTables-table_1 - Cannot reinitialise DataTable.
after adding this code:
<?php
<!-- Internationalisation responsive table -->
<script>
$('#dataTables-table_1').DataTable( {
language: {
processing: "Verwerken...",
search: "Zoeken:",
lengthMenu: "Bekijk _MENU_ records",
info: "_START_ tot _END_ van _TOTAL_ records zichtbaar",
infoEmpty: "0 van 0 records",
infoFiltered: "(totaal _MAX_ records)",
infoPostFix: "",
loadingRecords: "Records worden geladen...",
zeroRecords: "Er zijn geen records gevonden",
emptyTable: "De tabel is leeg",
paginate: {
first: "Eerste",
previous: "Vorige",
next: "Volgende",
last: "Laaste"
},
aria: {
sortAscending: ": sorteer oplopend",
sortDescending: ": sorteer aflopend"
}
}
} );
</script>
?>
I think it is because this is already in the script:
<?php
<script>
$(document).ready(function() {
$('#dataTables-table_1').DataTable({
responsive: true
});
});
</script>
?>
But I am not succeeding in combing them, everything I try I am loosing the first or second JS script. Please help me out.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Yes the problem is they need to be combined. I suspect you are missing a comma separating the two options. Should look like this:
Kevin
Thx Kevin!