Json data help.

Json data help.

felipenovafelipenova Posts: 2Questions: 0Answers: 0
edited December 2012 in General
Hi,
I have a JSON generate by RestEasy in this format:
[code]{"aaData":{"tipo":"Tipo1","descResumida":"DescRes1","descDetalhada":"DescDet1"}}[/code]

And my js is there:

[code]$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "http://localhost:8080/teste_interface/rest/resource/hello",
"fnServerData": function( sUrl, aoData, fnCallback,oSettings ) {
oSettings.jqXHR = $.ajax({
'dataType': 'json',
'type': 'POST',
'url': sUrl,
'data': aoData,
'success': fnCallback
});
}
} );[/code]

And is showing "No matching records found".
Please, i need a help.
Thanks.

Replies

  • allanallan Posts: 63,531Questions: 1Answers: 10,474 Site admin
    http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read

    Post a link to a test case please.

    Allan
  • felipenovafelipenova Posts: 2Questions: 0Answers: 0
    My JSON was wrong, the right would [code]{"aaData":[{"tipo":"Tipo1","descResumida":"DescRes1","descDetalhada":"DescDet1"}]}[/code]

    And my js:
    [code]'sAjaxSource': 'http://localhost:8080/teste_interface/rest/resource/hello',
    'sAjaxDataProp': 'aaData'[/code]

    Thanks
This discussion has been closed.