The data table can't be reloaded.
The data table can't be reloaded.
Hi,
I'm trying this datatable.ajax.reload() function. But I tried several different ways, can't get it working. The initial load of the table is fine. But after 5 sec the interval, in the firebug console, I can see the http GET successfully get the data back from the server every 5 secs. However, in the web page, the data table doesn't re-draw. Just showing a msg saying "Processing...". Any idea what I did wrong?
PS: I just did the datatables debugger, code is, "unoqap". and the version of DataTables I use is 1.10.0.
Thank you very much!
Joe
table holder
<table id="dataTable" class="display" width="80%">
< thead>
< tr>
< th align="center" width="15%">Name</th>
< th align="right"></th>
< th align="left">Address</th>
</ tr>
</ thead>
</ table>
init table:
dataTable = $('#dataTable').DataTable({
"bFilter": false,
"bInfo": false,
"paging": false,
"ordering": false,
"processing": true,
"serverSide": true,
"ajax": {
"url": "relative url to local server resources"
},
"initComplete": function() {
setInterval(function() {
dataTable.ajax.reload();
}, 5000);
}
});
Replies
I found the problem. It's on the server side. My bad. I always give a "draw: 1" in the server response. After I remove "draw" parameter, everything is fine.
Thank you very much for the great data table lib!!