Looking at the "fnServerCallback" function parameter when initialising a Datatable, is there a way to know or set the "aoData" variable? Where is this variable set? Can I change the "name" attribute inside the array of objects?
I am asking this because knowing how aoData is set might prove useful when trying to pass data to a server.
You can get access to aoData at any time by using fnSettings() (you can check its description here) function. Inside returned settings there is aoData object ready for you.
var oTable;
$(document).ready(function() {
oTable = $('#example').dataTable();
var oSettings = oTable.fnSettings();
/* Show an example parameter from the settings */
alert( oSettings.aoData );
} );
What exactly do you need to do?If you need to pass additional data to a server you can look at this example
EDIT - i found out this:
aoData is a name / value array of variables which jQuery will take and send to the server, so you can read them as POST (or GET if you elect to use that) variables.
You have "name" and "value" parameters defined twice in the same object... Try:
aoData.push( { "name": "blah", "value": "blahblah" } ); aoData.push( { "name": "thing", "value": "thingsvalue" } );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With