using AJAX POST to fill my datatable

using AJAX POST to fill my datatable

sentencedsentenced Posts: 1Questions: 0Answers: 0
edited January 2012 in General
Hi guys.
my problem is that my datatable don't fill by an AJAX POST.
the table is blank and it show "Processing...". my firebug don't show any error.

here is my returned json example data:
[code]
{
"sEcho": "1",
"iTotalRecords": "1",
"iTotalDisplayRecords": "1",
"aaData": [
[
"Examplenumber",
"Examplename",
"Examplename2",
"2012-01-27 16:18:50",
"0",
"Example Text"
]
]
}
[/code]

and here the js:
[code]
oTable = $('#instances_table').dataTable({
'bFilter' : true,
'bProcessing' : true,
'bServerSide' : true,
'sAjaxSource' : 'get_user_instances_ajax',
'fnServerData' : function ( sSource, aoData, fnCallback ) {
aoData.push(
{ "name": "id", "value": $.trim( $('#id_instances').val().toString()) },
);
$.ajax({
'dataType' : 'json',
'type' : 'POST',
'url' : sSource,
'data' : aoData,
'success' : function(json) {
fnCallback(json);
}
});
},
'bPaginate' : false,
'bLengthChange' : false,
'iDisplayLength' : 25,
'bSortClasses' : true,
}

[...]

[/code]

have anybody an idea what i make false?

Replies

  • intrinsicintrinsic Posts: 14Questions: 0Answers: 0
    edited February 2012
    Where do you set the URL to call your webservice? Wheres the complete code so we can get it working without having to write extra code? sSource is the URL for the webservice right? then where do I set it to a valid url?
This discussion has been closed.