using JQuery Datatables and all is going well.
I’ve worked out how to send addtional information from the client to the server. Now, I want to go back the other way.
So, how do I send extra information from the server to the client. I would have thought I could add an extra entry in the returned JSON and pull it out somewhere. One item I’d perhaps like to send back is how long the server took to handle the response. I can then show this information to the user.
Any help would be much appreciated. Thanks
I think you got quite everything right. You just need to attach the additional data server side in the JSON object and then get it in “fnServerData”. You can add this code to the inizialization object:
Server side you can add as many parameters as you want: Usually you have a json with 3 parameters “iTotalRecords” (total number of rows), “iTotalDisplayRecords” (Filtered total if you are using filters) and aaData (An associative array with the rows). If you add for example “iProcessingTime” (time it took to process server side) You could do:
Is this what you need?