server_side problems
server_side problems
I cannot get the server_side.html example to function.
The string echoed by server_processing.php is:
{"sEcho": , "iTotalRecords": 1, "iTotalDisplayRecords": 1, "aaData": [ ["Roger","Rabbit","348957347","8934758934","roger@rabbit.com"]] }
However, the server_side.html just displays "processing..." and does not show this record.
All of the other static examples work.
Could someone assist please?
The string echoed by server_processing.php is:
{"sEcho": , "iTotalRecords": 1, "iTotalDisplayRecords": 1, "aaData": [ ["Roger","Rabbit","348957347","8934758934","roger@rabbit.com"]] }
However, the server_side.html just displays "processing..." and does not show this record.
All of the other static examples work.
Could someone assist please?
This discussion has been closed.
Replies
I altered it so it pulled multiple records from the database, and it displayed perfectly with the ajax.html code.
The problem is when you add "bServerSide": true to the javascript.
Actually the problem is quite certainly with the JSON being passed back (try running it through www.jsonlint.com for example). The sEcho parameter in the object has no value - which will cause the parsing to fail. So two thing come to mind:
1. Are you using DataTables 1.5 beta 11?
2. Are you correctly echoing sEcho back?
Regards,
Allan
No idea why sEcho is blank, probably the reason why it is failing.
I am using DataTables 1.5 beta 11 downloaded today.
How is sEcho passed? what should it be?
No other changes to the script were made at all.
Passed it through jasonlint, sEcho is the problem. Is is as a get_value, yet nothing seems to be sent to the script from the html file
Thanks,
Glenn
sEcho is GET parameter send by DataTables along with all the other parameters needed for reading the data base and it just needs to be echoed back (hence the name :-) ). Something like 'echo $_GET['sEcho'];' for example.
You might want to check that the parameter is being send to the server (using Firebug etc) and that the server code you have is passing it back.
Regards,
Allan