I'm using the datatables framework described here:
https://datatables.net/examples/server_side/simple.html
I'm able to get the example defined at this url to work on the initial page load. However the sort and page buttons do not work. When the button is pressed the ajax call seems to be called: the server returns a json string representing the data (it it the same string shown in the ajax tab). The call seems to return the data to the page (I can see the json string in the response using Chrome tools). However, the table does not seem to refresh and the "Processing..." window never clears.
This is what the javascript in the page looks like:
<head>
<script>
$(document).ready(function() {
$('#example').DataTable( {
"processing": true,
"serverSide": true,
"ajax": "${home}/Forward?actionClass=serverexample.ServerExampleAction"
} );
} );
</script>
</head>
What am I doing wrong here?
--- EDIT ------------
Also, is there a way I can debug this (e.g. add an alert to see what code is actually executing, I'm not using the minimized js, I'm using datatables.js).
The JSON returned by the query is this:
{
"draw": 10,
"recordsTotal": 57,
"recordsFiltered": 57,
"data": [
[
"Caesar",
"Vance",
"Pre-Sales Support",
"New York",
"12th Dec 11",
"$106,450"
],
[
"Cara",
"Stevens",
"Sales Assistant",
"New York",
"6th Dec 11",
"$145,600"
],
[
"Cedric",
"Kelly",
"Senior Javascript Developer",
"Edinburgh",
"29th Mar 12",
"$433,060"
]
]
}