""No data available in table" and JSON errors, but good JSON?

""No data available in table" and JSON errors, but good JSON?

lorsungculorsungcu Posts: 2Questions: 0Answers: 0
edited January 2014 in General
In my test set up, I get "No data available in table", but in the datatables live test, I get this error:
https://www.dropbox.com/s/f5fz3xevykk933p/Capture.PNG

Here's my JSON:

[code]{
"aaData": [
{
"id": "70",
"q1": "4",
"q2": "3",
"q3": "4",
"q4": "1",
"call_id": "45",
"cid_name": "User Name",
"cid_number": "999"
},
{
"id": "71",
"q1": "0",
"q2": "3",
"q3": "3",
"q4": "4",
"call_id": "46",
"cid_name": "User Name",
"cid_number": "999"
},
{
"id": "72",
"q1": "2",
"q2": "3",
"q3": "5",
"q4": "1",
"call_id": "47",
"cid_name": "User Name",
"cid_number": "999"
},
{
"id": "73",
"q1": "2",
"q2": "5",
"q3": "4",
"q4": "2",
"call_id": "48",
"cid_name": "User Name",
"cid_number": "999"
},
{
"id": "74",
"q1": "2",
"q2": "4",
"q3": "2",
"q4": "3",
"call_id": "49",
"cid_name": "User Name",
"cid_number": "999"
},
{
"id": "75",
"q1": "2",
"q2": "5",
"q3": "4",
"q4": "2",
"call_id": "50",
"cid_name": "User Name",
"cid_number": "999"
},
{
"id": "76",
"q1": "3",
"q2": "5",
"q3": "2",
"q4": "1",
"call_id": "51",
"cid_name": "User Name",
"cid_number": "999"
}
]
}[/code]

Here's my datatables script:

[code]$(document).ready(function() {
oTable = $('#infoTable').dataTable({
"sAjaxSource": "../scr/tbl.php",
"aaSorting": [[0, 'asc']],
"sAjaxDataProp":"",
"bAutoWidth": true,
"bDeferRender": true,
"bFilter": true,
"bServerSide": false,
"sEmptyTable": "The table is really empty now!"
});

$('#reload').click(function () {
oTable.fnReloadAjax();
});
});[/code]

Here's the table:

[code]


Call ID
Question 1
Question 2
Question 3
Question 4
Caller ID Name
Caller ID Number







[/code]

I have checked the pages that the warning directs me to, and have double checked that the JSON is good, it is according to jslint. Sorry if this is obvious, I'm new at this and am not sure where else to look. Thanks!

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Use mData to tell DataTables what property show be read for each column.

    Allan
This discussion has been closed.