I'm trying to integrate an HTML5 export button in a datatable by using server side processing. The data is getting exported but only those which are visible in the datatable. All I want is to export all of the data. My code is below. I'm new to it could anyone please help me out with this.
jQuery("#table_data").dataTable({
'processing': true,
'serverSide': true,
"scrollX":true,
'bSearchable': true,
lengthMenu: [[10, 25, 100, -1], [10, 25, 100, "All"]],
"ajax": {
'type': 'POST',
"url": ajax_object.ajaxurl,
"dataType": "json",
"data": {action: 'ajax_datatable', id: form_id}
},
"dom": 'Bflrtip',
buttons: [
{
extend: 'csvHtml5',
exportOptions: {
columns: ':visible',
modifier : {
// DataTables core
page : 'all'
}
}
},
{
extend: 'pdfHtml5',
exportOptions: {
columns: ':visible',
modifier : {
// DataTables core
page : 'all'
}
},
orientation: 'landscape',
PdfSize: "A3"
}],
"order": [[ data.dt_column_order, "desc" ]],
"columnDefs": [{
"targets": [parseInt(data.dt_column_target)],
"visible": false,
"searchable": false
}],
"oLanguage": {
"sProcessing": "<div></div><div></div><div></div><div></div><div></div>"
},
"fnPreDrawCallback": function (oSettings) {
jQuery('#table_data').css('opacity', '0.2');
},
"fnDrawCallback": function () {
jQuery('#table_data').css('opacity', '1');
}
});
Please help me. What is wrong and how I can solve this problem?