Can't get the "CSV" export button to be displayed in the live.datatables.net

Can't get the "CSV" export button to be displayed in the live.datatables.net

langelange Posts: 9Questions: 3Answers: 0
edited March 4 in Free community support

Link to test case:
https://live.datatables.net/sozuyabe/1/edit

Description of problem:
I can't get the "CSV" export button to be displayed in the live.datatables.net. If I add the the extend: 'csv', config. the button vanishes - without a button is displayed. I guess I make a simple mistake but I just can't find it.

Answers

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951

    The live.datatables.net environment defaults to loading jquery.js, datatables.js and datatables.css. You added this to the bottom of the HTML tab:

        <script src="https://code.jquery.com/jquery-3.7.0.min.js"></script>
        
        <script src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script>
        <script src="https://cdn.datatables.net/buttons/2.4.1/js/dataTables.buttons.min.js"></script>
        <script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.colVis.min.js"></script>
        <script src="https://cdn.datatables.net/fixedcolumns/4.3.0/js/dataTables.fixedColumns.min.js"></script>
        <script src="https://cdn.datatables.net/searchbuilder/1.5.0/js/dataTables.searchBuilder.min.js"></script>
    

    With this you are now loading jquery.js and datatables.js twice. This will cause problems with the buttons. Make sure to only load them once. Also you haven't loaded any .css files.

    Additionally you need to load buttons.html5.js for the export buttons. Updated test case.
    https://live.datatables.net/sozuyabe/2/edit

    Kevin

  • langelange Posts: 9Questions: 3Answers: 0

    Thank you Kevin!

Sign In or Register to comment.