problem in datatables need help
problem in datatables need help
the code echo json_encode( SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns )); from here http://services.sosteam-group.com/server_side/scripts/server_processing.php returns {"draw":0,"recordsTotal":1049,"recordsFiltered":1049,"data":[{"a0":"28","a1":"226430 \/ 215002309","a2":"11\/01\/2015","a3":"Paid","a4":"PHILIPPE NIEMEGEERS","a5":"AG Insurance","a6":"","a7":"Chris, Jarrod"},{"a0":"798","a1":"PRIVE","a2":"01\/12\/2015","a3":"Closed","a4":"Mr Ellis","a5":"SOS TEAM","a6":"Faycal","a7":"Chris, Salma, Pascale, Jarrod"}]} but the test link from here http://services.sosteam-group.com/server_side/simple.html says No matching records found.
if i change the echo server_processing.php to echo '{"draw":0,"recordsTotal":2,"recordsFiltered":2,"data":[{"a0":"28","a1":"226430 \/ 215002309","a2":"11\/01\/2015","a3":"Paid","a4":"PHILIPPE NIEMEGEERS","a5":"AG Insurance","a6":"","a7":"Chris, Jarrod"},{"a0":"798","a1":"PRIVE","a2":"01\/12\/2015","a3":"Closed","a4":"Mr Ellis","a5":"SOS TEAM","a6":"Faycal","a7":"Chris, Salma, Pascale, Jarrod"}]}'; the table from simple.html gives a table with two rows, where is so problem? please help.
Answers
i've commented "order": [[0, 'desc']] from simple.html and it show only one row instead of 2, if you search for '01/12/2015' you get the second result.. thoughts?
The json is identical aside from the recordsTotal/Filtered values. no problem there. Is that example currently using the echo json? Are you still having a problem there, or just the order thing now?
Digging into your code the only problem I see is two commas that you forgot to comment.
{ "data": "a7" }, <-------------------------------------------------------
/{
"class": "details-control",
"orderable": true,
"data": null,
"defaultContent": ""
}/
], <-----------------------------------------------------------
//"order": [[0, 'desc']]
}
Your php is only returning one record, that is why you are only seeing one record in the table...
Request:
http://services.sosteam-group.com/server_side/scripts/server_processing.php?draw=1&columns%5B0%5D%5Bdata%5D=a0&columns%5B0%5D%5Bname%5D=&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=true&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=a1&columns%5B1%5D%5Bname%5D=&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=a2&columns%5B2%5D%5Bname%5D=&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=a3&columns%5B3%5D%5Bname%5D=&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=a4&columns%5B4%5D%5Bname%5D=&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=a5&columns%5B5%5D%5Bname%5D=&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=a6&columns%5B6%5D%5Bname%5D=&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=true&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=a7&columns%5B7%5D%5Bname%5D=&columns%5B7%5D%5Bsearchable%5D=true&columns%5B7%5D%5Borderable%5D=true&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=10&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1461880174658
Response:
{"draw":1,"recordsTotal":1049,"recordsFiltered":1049,"data":[{"a0":"28","a1":"226430 \/ 215002309","a2":"11\/01\/2015","a3":"10","a4":"PHILIPPE NIEMEGEERS","a5":"11,4,12,26,","a6":"4,15,21,","a7":"4,15,21,"}]}
Based on this, i'd say there is something wrong with your server-side processing.