Unable to attach responseJsonObject(array of objects to datatable.
Unable to attach responseJsonObject(array of objects to datatable.
raheem_jcp
Posts: 1Questions: 1Answers: 0
Hi, I am new to datatable and I am trying to attach jsonResponseObject which contains list of object but datatable is not getting populated.
var dataString = JSON.stringify({amount: amt, fromBic: fromBank, toBic: toBank, trnNumber: trnno, status: status, benAcc: benAccountNumber, ordAcc: oACCountNumber});
$.ajax({
url: "/ContextPath/Module/SearchDetails/",
type: "POST",
dataType : 'json',
contentType: "application/json; charset=utf-8",
data: dataString, //Stringified Json Object
success: function(resposeJsonObject)
{
var data = resposeJsonObject;
alert("** SEARCH **" + resposeJsonObject );
var ot = $(".xyztable").dataTable({
"bDestroy": true,
"bProcessing": true,
"aaData": resposeJsonObject,
"aoColumns": [
{
"fnRender": function(oObj) {
return '<input type="checkbox" value="' + oObj.aData[3] + '">';
//return '<input type="checkbox" value="">';
},
"aTargets": [0]
} ,
{ "mData": "dir" },
{ "mData": "toBic" },
{ "mData": "messageNumber" },
{ "mData": "trnNumber" },
{ "mData": "valueDate" },
{ "mData": "amount" },
{ "mData": "status" }
]
});
},
error: function(jqXHR, textStatus, errorThrown)
{
alert("Contact " + textStatus + " " + errorThrown + " !");
}
});
});
Error: Requested unknown parameter.......
Can anyone tell me where i'm going wrong?
Any help is truly appreciated
This discussion has been closed.