Datatable Buttons not working anymore (TypeError: "x" is not a function)
Datatable Buttons not working anymore (TypeError: "x" is not a function)
Since a few days, the datatable buttons doesn't seem to work anymore
see https://dev.hockeyarenas.net/index.php?strSearch=furus&page=0199
Firefox inspector tells:
Uncaught TypeError: e.ext.features.register is not a function
<anonymous> https://dev.hockeyarenas.net/inc/js/DataTables/Buttons-2.4.2/js/dataTables.buttons.min.js:4
<anonymous> https://dev.hockeyarenas.net/inc/js/DataTables/Buttons-2.4.2/js/dataTables.buttons.min.js:4
<anonymous> https://dev.hockeyarenas.net/inc/js/DataTables/Buttons-2.4.2/js/dataTables.buttons.min.js:4
It also stopped working with 2.2.3 - that's why I updated on the test version
Same error on production though
Uncaught TypeError: u.ext.features.register is not a function
<anonymous> https://hockeyarenas.net/inc/js/DataTables/Buttons-2.2.3/js/dataTables.buttons.min.js:54
<anonymous> https://hockeyarenas.net/inc/js/DataTables/Buttons-2.2.3/js/dataTables.buttons.min.js:5
<anonymous> https://hockeyarenas.net/inc/js/DataTables/Buttons-2.2.3/js/dataTables.buttons.min.js:5
I'm using the following scripts
<script src="inc/js/DataTables/jQuery-3.7.0/jquery-3.7.0.min.js"></script>
<script src="https://nightly.datatables.net/js/jquery.dataTables.min.js"></script>
<script src="https://nightly.datatables.net/responsive/js/dataTables.responsive.min.js"></script>
<script type="text/javascript" language="javascript" src="inc/js/DataTables/Buttons-2.4.2/js/dataTables.buttons.min.js"></script>
<script type="text/javascript" language="javascript" src="inc/js/DataTables/JSZip-3.10.1/jszip.min.js"></script>
<script type="text/javascript" language="javascript" src="inc/js/DataTables/pdfmake-0.2.7/pdfmake.min.js"></script>
<script type="text/javascript" language="javascript" src="inc/js/DataTables/pdfmake-0.2.7/vfs_fonts.js"></script>
<script type="text/javascript" language="javascript" src="inc/js/DataTables/Buttons-2.4.2/js/buttons.html5.min.js"></script>
<script type="text/javascript" language="javascript" src="inc/js/DataTables/Buttons-2.4.2/js/buttons.print.min.js"></script>
This question has an accepted answers - jump to answer
Answers
We're currently merging DataTables 2 into the nightly builds, so it's very likely going to be related to that. I see you're using named versions of the Buttons releases, but the nightly build for DataTables and Responsive. It would be worth downloading the latest release for both of those and using that - nightly builds do tend to be less stable than named releases.
Colin
Thank you for your reply. I changed the nightly to the named version and it's working fine again now.