Stuck on processing on server side

Stuck on processing on server side

illectronicillectronic Posts: 20Questions: 0Answers: 0
edited October 2013 in General
My JSON response looks correct. Here is the first row of the server_side.php. It is also saying my first paremter control_id is incorrect.

[code]
{"sEcho":1,"iTotalRecords":0,"iTotalDisplayRecords":"41159","aaData":[["437","LAB.437.mma_200511.dat","LAB","1305577","68841189","08-DEC-05","2323186193",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],
[/code]

Here is the javascript:

[code]
$(document).ready(function() {
var Table = $("#top-table").dataTable({
"bFilter":false,
"iDisplayLength": 50,
"bPaginate":true,
"bProcessing": true,
"bServerSide": true,
"bInfo":false,
iTotalDisplayRecords: 50,
"sAjaxSource": "ssi/server_side.php",
"aoColumns": [
{ "mDataProp": "CONTROL_ID" },
{ "mDataProp": "FILE_NAME"},
{ "mDataProp": "LINE_CNT"},
{ "mDataProp": "BYTE_CNT"},
{ "mDataProp": "CREATE_DT"},
{ "mDataProp": "FILE_CKSUM" },
{ "mDataProp": "TXN" },
{ "mDataProp": "ORG_FILE_NAME"},
{ "mDataProp": "FILE_DIR"},
{ "mDataProp": "INT_EXT_FLG"},
{ "mDataProp": "PID"},
{ "mDataProp": "PRIORITY"},
{ "mDataProp": "OSTIMESTAMP"},
{ "mDataProp": "FINAL_TBL_NAME"},
{ "mDataProp": "CNSL_FILE_MV_LU_ID"},
{ "mDataProp": "LAST_JOB_NAME"},
{ "mDataProp": "DELIMITER"},
{ "mDataProp": "NO_TOKENS"},
{ "mDataProp": "MINLENGTH"},
{ "mDataProp": "HEAD_DATA"},
{ "mDataProp": "TAIL_DATA"}
],
"sAjaxSource": "ssi/server_side.php",
"fnServerData": function ( sSource, aoData, fnCallback ) {
$.ajax( {
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aoData,
"success": fnCallback
} );
}
});
});
[/code]

My server_side.php can be seen on pastebin because it is too long: http://pastebin.com/zNgXFu1a

Thanks

Replies

  • illectronicillectronic Posts: 20Questions: 0Answers: 0
    I noticed iTotalDisplayRecords: 50, wasn't in quotes so I fixed that and got the same error.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Looks like you are returning an array of arrays in your aaData parameter. But your use of mDataProp (mData in DataTables 1.9.4) tells DataTables to expect an object. Which is it that you want?

    Allan
  • illectronicillectronic Posts: 20Questions: 0Answers: 0
    I want to return the actual data, so that would be the array I am assuming.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    In the format you have yes. So you wouldn't use mDataProp.

    Allan
  • illectronicillectronic Posts: 20Questions: 0Answers: 0
    I have tried mData. What should I be using?
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    You shouldn't be using anything at all - you aren't using objects, so you don't need to tell DataTables to read form an object. See: http://datatables.net/release-datatables/examples/server_side/server_side.html
  • illectronicillectronic Posts: 20Questions: 0Answers: 0
    Now it works, but when I click next it gets stuck on "processing". Also it says "unknown parameter 22 for row 0".
  • illectronicillectronic Posts: 20Questions: 0Answers: 0
    I fixed the unknown parameter issue by fixing my columns on the server_side.php but I still can't go through the list by clicking next. It gets stuck on processing.
  • illectronicillectronic Posts: 20Questions: 0Answers: 0
    I got it. It was sEcho!

    Thanks for this great script. On to more customizing
This discussion has been closed.