I am using jQuery DataTables with server-side processing.
I want to create a button. When that button is clicked, it should send current DataTable parameters (search, sort, etc) to the server-side script to generate MS Excel file using PHPExcel.
I am using jQuery DataTables with server-side processing.
I want to create a button. When that button is clicked, it should send current DataTable parameters (search, sort, etc) to the server-side script to generate MS Excel file using PHPExcel.
You can use ajax.params() to get the data submitted by DataTables to the server in the last Ajax request.
Then you can redirect to script that generates Excel file with these parameters using jQuery helper function $.param that converts array into query string.
For example:
window.location = '/getFile.php?' + $.param($('#example').DataTable().ajax.params());
where example is table ID.