0

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.

1
  • What have you tried to accomplish that? It's important to know how to ask to improve the chances of getting a good answer. Please, edit your question to include that information. Commented Jul 22, 2015 at 2:27

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.