What is the way to export a Datatables with checkboxes in the different formats available in JS ?

What is the way to export a Datatables with checkboxes in the different formats available in JS ?

lucasvavonlucasvavon Posts: 11Questions: 4Answers: 0

I'm facing problem who concerns the CSV export of a DataTable when I want to select the rows with checkboxes.

The code to initialize a table :

here, the configuration for DataTable :

With this configuration, I try to export only the checked boxes of my table :

Did you see the problem ? the selection doesn't work

If you have any idea, please let me know, thanks in advance.

Answers

  • kthorngrenkthorngren Posts: 20,141Questions: 26Answers: 4,736

    Doesn't look like you have enabled the Select Extension. You will need to install the select library (.js and .css) and enable the select extension. See the Select examples](https://datatables.net/extensions/select/examples).

    Kevin

  • lucasvavonlucasvavon Posts: 11Questions: 4Answers: 0
    edited January 2022

    //cdn.datatables.net/1.11.3/css/jquery.dataTables.min.css
    //cdn.datatables.net/buttons/2.1.0/css/buttons.dataTables.min.css
    //cdn.datatables.net/select/1.3.3/css/select.dataTables.min.css

    //code.jquery.com/jquery-3.5.1.js"></script>
    //cdn.datatables.net/select/1.3.3/js/dataTables.select.min.js
    //cdn.datatables.net/1.11.3/js/jquery.dataTables.min.js
    //cdn.datatables.net/buttons/1.6.2/js/dataTables.buttons.min.js
    //cdn.datatables.net/buttons/1.6.2/js/buttons.flash.min.js
    //cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js
    //cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js
    //cdn.datatables.net/buttons/1.6.2/js/buttons.html5.min.js
    //cdn.datatables.net/buttons/1.6.2/js/buttons.print.min.js

    (in script tag of course)

    "https:" is required ?

    all my calls in my html page, its correct ?

  • kthorngrenkthorngren Posts: 20,141Questions: 26Answers: 4,736
    edited January 2022

    Looks like you are loading the select library. At a minimum you need select: true in the Datatable initialization to enable row selection. Please see the Select extension docs for details of how to use the select extension.

    Kevin

Sign In or Register to comment.