I am working on datatables. I need to populate my data table with AJAX call BUT I am unable to do so. Here is my AJAX call:
$('#call_analysis_basic_table').DataTable ({
"ajax": {
"url": "getBasicCallAnalysisData.json",
"type": "POST"
},
"columns": [
{ "data": "ANUMBER" },
{ "data": "BNUMBER" },
{ "data": "DATETIME" },
{ "data": "DURATION" },
{ "data": "IMEI" },
{ "data": "IMSI" },
{ "data": "CELL ID" },
{ "data": "OPR ID" },
{ "data": "MSC ID" },
{ "data": "FILE ID" }
]
});
Datatable HTML code:
<table id="call_analysis_basic_table" class="display" cellspacing="0" width="100%">
<thead style="background-color:#4d7496;color:#fff;">
<tr>
<th>aNumber</th>
<th>bNumber</th>
<th>datetime</th>
<th>duration</th>
<th>imei</th>
<th>imsi</th>
<th>cellID</th>
<th>oprid</th>
<th>msc_id</th>
<th>file_id</th>
</tr>
</thead>
</table>
Expected JSON Response :
{
"result": [
[
"3028540439",
"3222027076",
"2017-06-01 07:58:50.0",
"984",
"45113694289302",
"45113694289302",
"34546789606976",
"410-07-511-19601",
"1",
"1",
"1"
],
[
"3028540439",
"3224712938",
"2017-05-11 06:07:21.0",
"4",
"12962129644848",
"12962129644848",
"34469708781694",
"410-06-651-30213",
"1",
"1",
"1"
]
],
"success": true,
"error": "no error"
}
After making this call, The response from server comes but response doesn't populate into datatable. It Shows me this error
DataTables warning: table id=call_analysis_basic_table - no error
Any hint, How can I populate this JSON response to my datatable?
resultkey from the response Object.