DataTable inicialization with AJAX
DataTable inicialization with AJAX
wondris009
Posts: 8Questions: 0Answers: 0
Hi Allan,
i have simple table with one row.
Time (UTC)
Message ID
Device ID
Communication status
Current config
Current config
New config
Raw data message
12/11/2010 14:44
4
16
OK_WITH_RECO...
1234
cz.cngroup.prada.common.dto.RawDataDTO@72
N
16#4#1012161110#99#1#T-Mobile#145#4174#HE...
i am trying to make it ajaxable, my inicialization code:
$("#rawDataTable").dataTable({
"bServerSide": true,
"sAjaxSource": "/ajax/constructRawDataTableAsJSON"
});
After inicialization i got this error:
DataTables warning (table id = 'rawDataTable'): Added data (size undefined) does not match known number of columns (9)
json from server:
{"aaData":[{"communicationResult":"OK_WITH_RECONF","currentConfig":"1234","deviceId":16,"id":72,"messageId":4,"name":"cz.cngroup.prada.common.dto.RawDataDTO@72","newConfig":false,"rawData":"16#4#1012161110#99#1#T-Mobile#145#4174#HEND#1111111110#152#END#","serverTimestamp":"2010-11-12T14:44:36"}],"communicationResult":null,"communicationResultList":["OK","OK_WITH_RECONF","INVALID_DATA_HEADER","INVALID_DATA_HEADER_WITH_RECONF","BROKEN_CONNECTION","RECONFIGURATION_FAILS","TIMEOUT"],"dateFrom":"2010-11-11T11:33:44","dateFromString":"11\/11\/2010 11:33","dateTo":"2010-11-15T11:33:44","dateToString":"15\/11\/2010 11:33","defaultView":true,"deleteMessage":null,"deviceIdRange":null,"iTotalDisplayRecords":0,"iTotalRecords":0,"messageIdRange":null,"rawDataDetails":null,"selectedId":null,"selectedRawDataIds":null}
As i can see JSON has for aaData 9 columns same as HTML table. I don know where is the problem. Please can you give me some advice?
Thanks a lot Lukas
i have simple table with one row.
Time (UTC)
Message ID
Device ID
Communication status
Current config
Current config
New config
Raw data message
12/11/2010 14:44
4
16
OK_WITH_RECO...
1234
cz.cngroup.prada.common.dto.RawDataDTO@72
N
16#4#1012161110#99#1#T-Mobile#145#4174#HE...
i am trying to make it ajaxable, my inicialization code:
$("#rawDataTable").dataTable({
"bServerSide": true,
"sAjaxSource": "/ajax/constructRawDataTableAsJSON"
});
After inicialization i got this error:
DataTables warning (table id = 'rawDataTable'): Added data (size undefined) does not match known number of columns (9)
json from server:
{"aaData":[{"communicationResult":"OK_WITH_RECONF","currentConfig":"1234","deviceId":16,"id":72,"messageId":4,"name":"cz.cngroup.prada.common.dto.RawDataDTO@72","newConfig":false,"rawData":"16#4#1012161110#99#1#T-Mobile#145#4174#HEND#1111111110#152#END#","serverTimestamp":"2010-11-12T14:44:36"}],"communicationResult":null,"communicationResultList":["OK","OK_WITH_RECONF","INVALID_DATA_HEADER","INVALID_DATA_HEADER_WITH_RECONF","BROKEN_CONNECTION","RECONFIGURATION_FAILS","TIMEOUT"],"dateFrom":"2010-11-11T11:33:44","dateFromString":"11\/11\/2010 11:33","dateTo":"2010-11-15T11:33:44","dateToString":"15\/11\/2010 11:33","defaultView":true,"deleteMessage":null,"deviceIdRange":null,"iTotalDisplayRecords":0,"iTotalRecords":0,"messageIdRange":null,"rawDataDetails":null,"selectedId":null,"selectedRawDataIds":null}
As i can see JSON has for aaData 9 columns same as HTML table. I don know where is the problem. Please can you give me some advice?
Thanks a lot Lukas
This discussion has been closed.
Replies
sorry for ma question, i have found that instead of sending aaData: [{column_name:column_value}] i need to send only aaData: [{column_value}]
I will try it and send notice if it solve my problem.
Sorry again, hope that it doesn't waste your time so much.
Lukas