Controling the data which datatables sends

Controling the data which datatables sends

iconofsiniconofsin Posts: 3Questions: 3Answers: 0

I understand that when in server side processing mode every time an ajax call is made datatables sends various values which on the server side are available in the $POST_ or $GET_ super globals (dependent on which method you use to make the request). (assuming your using PHP).

The sent values are listed here
https://www.datatables.net/manual/server-side

for example if i use the following code, the 2nd page button is pressed at 10 rows are displayed per page

$(document).ready(function() {
$('#example').DataTable( {
"processing": true,
"serverSide": true,
"ajax": {
"url": "scripts/post.php",
"type": "POST"
} );
} );

Then when i click on the page 2 pagination button an ajax call will be made and the 'star't paramerter will be set to 10 and the 'length' parameter will be sent to 10.

my questions are as follows.

1)
If my server side script requires information which datatables does send to have a different name (so for example 'start' may actually need to be called 'first') how can i make this change.

2)
How can I send my own custom values with the AJAX request.

also by extension is it possible to read one of the values datatables does send before it is sent so that i can do something with in on the client side before the ajax call is made?

This discussion has been closed.