Using fnServerData with a deffered object

Using fnServerData with a deffered object

AlexandreAlexandre Posts: 3Questions: 1Answers: 0
edited November 2013 in General
For some reason my dataTables aint loading data when it gets initialized with a deffered object,
[code]
var Helper = {
ListByID: function (id) {
return $.ajax({
type: "POST",
url: "Stuff.aspx/axListById",
data: JSON.stringify({
"id": id
}),
contentType: "application/json; charset=utf-8",
dataType: "json"
});
}
};
$('#tbHelper').dataTable({
"sDom": '<"clear">rti',
"bInfo": false,
"iDisplayLength": 25,
"oTableTools": {
"sSwfPath": "../img/datatables/copy_csv_xls_pdf.swf",
},
"bProcessing": true,
"oLanguage": {
"sUrl": "../language/datatables.language." + $("#hUiCulture").val() + ".txt"
},
"fnServerData": function (sSource, aoData, fnCallback) {
Helper.ListByID($("#id").val()).done(function (data) {
fnCallback(jQuery.parseJSON(data.d || "null")); //my aaData is inside a "d" object due ASP.NET restrictions, so thats not the matter
});
},
....
[/code]

However, if i manually use fnReloadAjax() it works perfectly.

Allan?
This discussion has been closed.