fnServerData

fnServerData

srayner02srayner02 Posts: 15Questions: 0Answers: 0
edited November 2010 in General
i am trying to pass additional parameters to the server when fetching ajax data.

[code]
oTableSearch = $('#search-results').dataTable({
"bJQueryUI": true,
"bServerSide": true,
"sAjaxSource": "/nests/notinnest",
"fnServerData": function ( sSource, aoData, fnCallback ) {
aoData.push( { "name" : "iNestId", "value" : $('#nest_id').html() } );
aoData.push( { "name" : "nThickness", "value" : $('#thickness').html() } );
aoData.push( { "name" : "sMaterial", "value" : $('#material').html() } );
$.getJSON( sSource, aoData, function (json) {
/* Do whatever additional processing you want on the callback, then tell DataTables */
fnCallback(json);
} );

}
});

[/code]

the server is returning the following json responce, but the data does not get added to the table.

{"sEcho": 1,
"iTotalRecords": ,
"iTotalDisplayRecords": ,
"aaData": [
["33456",
"New Part",
"0.70",
"GALV",
"Add"]

]}

how do i get the returned json added to the datatable?
This discussion has been closed.