How to access data used by ajax for Server-side processing
How to access data used by ajax for Server-side processing
I would like to use one class for sql queries for other views except table view (e.g. calendar). Other views should use the same filters, so the question is how could I access data like columns[i][search][value], which are being used for ajax calls?
This discussion has been closed.
Answers
What language are you using for your server side?
You could send the parameters as a JSON string using
ajax.data. I think the last example in the docs show how.Kevin
Maybe I did not write precisely. I need to get these data in JS independently of Datatables ajax call, for other ajax call.
You can get the data sent to the sever using the
preXhrevent.Kevin
I found this way:
var dTable = $('#tablename').dataTable();var oSettings = dTable.fnSettings();var aoData = dTable._fnAjaxParameters(oSettings);console.log('data:'+JSON.stringify(aoData));