Trouble with fnServerParams

Trouble with fnServerParams

dondon Posts: 2Questions: 0Answers: 0
edited August 2012 in DataTables 1.9
Hi,
I'm new to DataTables, so the problem is probably mine. I'm using the following in the js, using the example, custom_vars.html, as a guide

$(document).ready(function() {
$('#example').dataTable( {
"sScrollY": "300px",
"bProcessing": true,
"sServerMethod": "POST",
"sAjaxSource": 'NewCompData.php',
"fnServerParams": function ( aoData ) {
aoData.push( { "name": "more_data", "value": "my_value" } );
}
} );
} );


and trying to capture the parameters in NewCompData.php with $newparams = $_POST(aoData);
I get an error in the foxfire debugger saying json is null on line 8686 of jquery.dataTables.js. I'm using dataTables version 1.9.3

Any help setting me on the right path would be appreciated.

Thanks
Don

Replies

  • dondon Posts: 2Questions: 0Answers: 0
    Found my error - to retrieve the data I should be using $newparams = $_POST(more_data); i.e. the value of the name and the POST returns the value - "my_value". On to more substantive coding using dataTables. This plug-in looks like a great addition; Thanks to all who have contributed.

    Don
This discussion has been closed.