Reputation: 873
In jquery DataTables it is possible to add server parameters through the method fnServerData
or fnServerParams
:
$("#myTable").dataTable({
"bServerSide": true,
"sAjaxSource": contextApp,
"fnServerParams" : function(aoData){
aoData.push("name":"paramName", "value":"paramValue");
}
)
Is it possible to do the same thing through fnSettings
method?
For example :
var myTable = $("#myTable").dataTable();
var oSettings = myTable.fnSettings();
//add server paramters to oSettings
Upvotes: 0
Views: 5041
Reputation: 66
It is possible since you can manipulate "aoServerParams" in oSettings - but why would you want to do this? Its not part of the public API (and although it isn't like to change in 1.x, it is possible).
Upvotes: 1
Reputation: 11
var myTable = $("#myTable").dataTable();
myTable.fnSettings().aoServerParams.push({"sName": "user",
"fn": function (aoData) {
aoData.push({
"name": "titre",
"value": titre
});
}});
Upvotes: 1