JQuery Datatables plugin - aoData, where and whence

Looking at the parameter of the fnServerCallback function when initializing Datatable, is there a way to find out or set the variable "aoData"? Where is this variable set? Can I change the "name" attribute inside an array of objects?

I ask this because knowing how aoData is installed may be useful when trying to transfer data to a server.

+7
source share
2 answers

You can access aoData at any time using fnSettings () (you can check its description here ). Inside the returned settings there is an aoData strong> 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 ); } ); 
+10
source

What exactly do you need to do? If you need to transfer additional data to the server, you can see this example

EDIT - I found out about this:

  • aoData is an array of variable names / values ​​that jQuery will receive and send to the server, so you can read them as POST variables (or GET if you decide to use).

  • You have the name and value parameters defined twice in the same object ... Try:

    aoData.push ({"name": "blah", "value": "blahblah"}); aoData.push ({"name": "thing", "value": "thingsvalue"});

0
source

All Articles