DataTables only export data for current page
DataTables only export data for current page
 delta7th            
            
                Posts: 1Questions: 1Answers: 0
delta7th            
            
                Posts: 1Questions: 1Answers: 0            
            Hello,
i have a problem using DataTables HTML5 Export Buttons Features,
i dont know what really happen to my code because this DataTables is new to me..
as we can see this is my configurator:
 $(document).ready(function() {
      table = $('#table').DataTable({
        "processing": true,
        "serverSide": true,
        "ajax": {
            "url": "<?php echo site_url(member/get_logtrans);?>",
            "type": "POST"
        },
        dom: 'Bfrtip',
         buttons: [
            {
                extend:    'copyHtml5',
                text:      'copy'
            },
            {
                extend:    'excelHtml5',
                text:      '<img src="<?php echo base_url();?>asset/img/excel.png" width="25px" height="25px"></img>'
            },
            {
                extend:    'pdfHtml5',
                text:      '<img src="<?php echo base_url();?>asset/img/pdf.png" width="25px" height="25px"></img>'
            }
        ],
 
      });
    });
I have total 12 Rows for the table,
the DataTables Drawn shown very nicely, it shows "Showing 1 to 10 of 12 Entries",
pagination run smoothly as well, it has 2 pages (1 for 10 rows, and the other for 2 rows).
but if i started to use export features, like copy to clipboard, export xls, and export pdf
IT ONLY GET 10 rows (current active page),
i want to get all rows for this section.
i have used DataTables Debugger... it shows i have only 10 for total rows.
Im so sorry to ask such this question.
Im new to this framework.
and sorry for such bad english.
I love DataTables, Thanks.
Answers
This is a commonly asked question about server-side processing and exporting data, which is why the answer can be found in the FAQs :-)
Allan