I am using new feature in Datatables: \"HTML5 export buttons\". I am loading data with Ajax.
https://datatables.net/extensions/buttons/examples/html5/simple.html
you can make a hidden extra table in your page then make a button for download all data , assign this code for make hidden table as datatable with all rows with these options
var options = {
"processing": true,
"serverSide": true,
"ajax": fullbase,
"language": {
"search": "Buscar: ",
"zeroRecords": "Datos no encontrados."
},
"initComplete": function(settings, json) {
$(".buttons-excel").click();
},
"iDisplayLength": 100000,
lengthMenu: [[10,25,50,100, 100000], [10,25,50, 100, "All"]],
"buttons": [{
extend : 'excel',
exportOptions : {
order : 'current',
page : 'all',
search : 'none'
}
}],
"dom": "Blfrtip",
};
you can see a trigger on export excel button in complete table event and will run automatically for user when user click on that button then get an excel with all data