Remote REST (JSON) Invocation. Stuck @ Processing...

Remote REST (JSON) Invocation. Stuck @ Processing...

chamuramyachamuramya Posts: 1Questions: 0Answers: 0
edited December 2012 in DataTables 1.9
I downloaded the trial version of DataTables Editor hoping to see if it would make my life easier; but so far not. I have a bunch of REST services, that are hosted in a different domain. Using the Editor REST example, I initialized the table as follows,

[code]

var editor; // use a global for the submit and return data rendering in the examples

$(document).ready(function() {
editor = new $.fn.dataTable.Editor( {
"ajaxUrl": {
"create": "POST http://localhost:9081/xxx/api/resource/accounts",
"edit": "PUT http://localhost:9081/xxx/api/resource/accounts/_id_",
"remove": "DELETE http://localhost:9081/xxx/api/resource/accounts/_id_"
},
"domTable": "#accountsTable",
"fields": [
{
"label": "Alernative Name : ",
"name": "acctaltname"
},
{
"label": "Business Unit :",
"name": "acctbucode"
},
{
"label": "Coverage Type :",
"name": "acctcvrgtypecode"
},
{
"label": "Sector :",
"name": "acctcvrgsctrcode"
},
{
"label": "Industry :",
"name": "acctcvrgindcodes"
},
{
"label": "Coverage ID :",
"name": "acctcvrgidcode"
},
{
"label": "Client ID :",
"name": "acctclientids"
},
{
"label": "IMT :",
"name": "acctimtcode"
},
{
"label": "Legacy Client ID :",
"name": "acctlegcclientids"
},
{
"label": "Client Name :",
"name": "acctname"
},
{
"label": "Domestic Buying Group ID :",
"name": "acctdombuygrps"
},
{
"label": "Notes :",
"name": "acctnote"
}
]
} );

$('#accountsTable').dataTable( {
"sDom": "Tfrtip",
"sAjaxSource": "http://localhost:9081/xxx/api/resource/accounts",
"bProcessing": true,
"bServerSide": true,
"bLengthChange": true,
"aoColumns": [
{ "mData": "acctname" },
{ "mData": "acctimtcode" },
{ "mData": "acctbucode" },
{ "mData": "acctcvrgsctrcode", "sClass": "center" },
{ "mData": "acctcvrgindcodes", "sClass": "center" }
],
"oTableTools": {
"sRowSelect": "multi",
"aButtons": [
{ "sExtends": "editor_create", "editor": editor },
{ "sExtends": "editor_edit", "editor": editor },
{ "sExtends": "editor_remove", "editor": editor }
]
}
} );
} );

[/code]

The table does not populate and its stuck with a "Processing...." message. The JSON response that comes back from the REST call is shown below and is valid per JSONLint. What am I missing here?

[code]
{
"aaData": [
{
"accountid": 9,
"acctaltname": "Includes NSTAR",
"acctbucode": "Northeast",
"acctclientids": "c111",
"acctcvrgidcode": "East",
"acctcvrgindcodes": "Utility and Energy Services",
"acctcvrgsctrcode": "Communications",
"acctcvrgsegmtcode": "Invest",
"acctcvrgtypecode": "Aligned",
"acctdombuygrps": "2",
"acctimtcode": "East",
"acctlegcclientids": "11111",
"acctname": "Northeast Utilities",
"acctnote": "",
"accttimestamp": 0,
"employee": [
{
"armapid": 9,
"armaptimestamp": 0,
"arrolecode": "Consultant",
"employeeid": 26,
"contact": {
"employeeid": 26,
"eminetid": "homer@simpson.com",
"emname": "Homer Simpson",
"emnotesid": "Homer/HS/US",
"emtimestamp": -62135748000000
}
}
]
}
]
}
[/code]
This discussion has been closed.