Buttons to datatable not working
Buttons to datatable not working
I want to add file export option to datatable 1.10.16, but when I add dom and buttons, I got following error Uncaught ReferenceError: jQuery is not defined
,
I have added following dependencies:
jQuery JavaScript Library v2.1.4 <script src="../lib/jquery/jquery.js"></script>,
DataTables 1.10.16 <script src="../lib/datatables/jquery.dataTables.js"></script>,
<script src="https://cdn.datatables.net/buttons/1.7.1/js/dataTables.buttons.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.7.1/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.7.1/js/buttons.print.min.js"></script>
Can you help me on this, as I am experimenting on jQuery datatable and file export?
$('#datatable1').DataTable({
responsive: true,
"order": [],
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
],
language: {
searchPlaceholder: 'Search...',
sSearch: '',
lengthMenu: '_MENU_ items/page',
}
});
Answers
Have you verified that
<script src="../lib/jquery/jquery.js"
is loading?Are you loading jquery.js only once?
Please post a link to your page or a test case replicating the issue so we can help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Without buttons library, datatables and jQuery are working properly.
Ok. The same questions and request stand. Without seeing the problem happen it will be difficult to debug. This standard example works.
Kevin