JSON object not dispalying in Jquery Data table

JSON object not dispalying in Jquery Data table

sarveshvemanasarveshvemana Posts: 4Questions: 0Answers: 0
edited October 2013 in Bug reports
JSON object not dispalying in Jquery Data table. Here is my sample code :
[code]
function getjQueryTable(){
$("#jQueryInvoices").dataTable({
"bServerSide": true,
"sAjaxSource": "/audit/listinvoice.do?action=getInvoices&carrierId=22&customerId=12096&shipperId=-1&status=Open&invoiceNumber=&toDateStr=&fromDateStr=&controlNumber=&runNumber=&dateCriteria=billDate&glCode=-1",
"bProcessing": true,
"sPaginationType": "full_numbers",
"bJQueryUI": true,
"aoColumns": [
{ "mDataProp": "invoiceNumber" },
{ "mDataProp": "invoiceAmount" },
{ "mDataProp": "contractNumber" },
{ "mDataProp": "status" }
]
});
}
[/code]
My server response is :

{ "ResultSet":{"aaData":[{"invoiceAmount":92.67,"sumQty":25,"customerId":12096,"contractId":401,"approvedAmount":0,"checkAmount":0,"createDate":"09/15/2013","invoiceId":9715002,"billDate":"09/16/2013",etc..
My Html Code is :





Invoice Number
Invoice Amount
Contract Number
Status













I'm getting error as "TypeError: aData is undefined
for ( var i=0, iLen=aData.length ; i

Replies

  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    Not a bug - you are returning the default expected JSON object: http://datatables.net/usage/ . Use sAjaxDataProp to change it.

    Allan
  • sarveshvemanasarveshvemana Posts: 4Questions: 0Answers: 0
    Thanks Allan. "sAjaxDataProp" Worked for me.I'm new to data tables.
This discussion has been closed.