简体   繁体   中英

KTDatatable does not export data to pdf,excel,csv files

在此处输入图片说明 the code :

datatable = $('#kt_datatable').KTDatatable({

        dom: 'Bfrtip',
        buttons: [
            'copyHtml5',
            'excelHtml5',
            'csvHtml5',
            'pdfHtml5'
        ],

KTDatatable does not support the export feature. But you can use this plugin to export as a PDF. Integrate it to your custom export button, by passing the data into the PDF plugin. https://github.com/simonbengtsson/jsPDF-AutoTable

var data = datatable.getDataSet();

Call this function to get the current data in the grid.

I would suggest CSV more than excel, and I think the easier one is to create a CSV file. You can also learn more about CSV text format here;

Export 2D javascript array to Excel sheet

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM