Rfreshing data table
Rfreshing data table
Hi everyone,
I really need your help.
I have this javascript code :
$(document).ready(function() {
var alertTable;
alertTable = $('#alert-table').dataTable({
/* "aaSorting" : [],*/
"bJQueryUI": true,
"bProcessing" : true,
"bServerSide" : true,
//"cache" :false,
/*"sServerMethod": "POST",*/
"sAjaxSource": '{% url "backend.audit.ajaj" %}',
"aoColumns": [
{ sWidth: '10%' },
{ sWidth: '16%' },
{ sWidth: '16%' },
{ sWidth: '15%' },
{ sWidth: '19%' },
{ sWidth: '24%' /*, sClass: "activity-log-desc" */ },
],
});
My problem is that I want to refresh this table every 3 seconds to get the new rows from my table.
If I cancel the "bServerSide" : true I can use something like :
var newtimer = setInterval( function () {
alertTable.fnReloadAjax(null, null, true);
}, 3000 );
and then it works. But I must have the bServerProcessing set to true (and of course fnReloadAJax doesnt work with it...)
My serverside code is written in Django.
I tried all the suggestions here anout fnDraw and none of them work for me and my table doesnt refresh.
I'll be very glad for any help.
Thanks,
Yevgeny
I really need your help.
I have this javascript code :
$(document).ready(function() {
var alertTable;
alertTable = $('#alert-table').dataTable({
/* "aaSorting" : [],*/
"bJQueryUI": true,
"bProcessing" : true,
"bServerSide" : true,
//"cache" :false,
/*"sServerMethod": "POST",*/
"sAjaxSource": '{% url "backend.audit.ajaj" %}',
"aoColumns": [
{ sWidth: '10%' },
{ sWidth: '16%' },
{ sWidth: '16%' },
{ sWidth: '15%' },
{ sWidth: '19%' },
{ sWidth: '24%' /*, sClass: "activity-log-desc" */ },
],
});
My problem is that I want to refresh this table every 3 seconds to get the new rows from my table.
If I cancel the "bServerSide" : true I can use something like :
var newtimer = setInterval( function () {
alertTable.fnReloadAjax(null, null, true);
}, 3000 );
and then it works. But I must have the bServerProcessing set to true (and of course fnReloadAJax doesnt work with it...)
My serverside code is written in Django.
I tried all the suggestions here anout fnDraw and none of them work for me and my table doesnt refresh.
I'll be very glad for any help.
Thanks,
Yevgeny
This discussion has been closed.
Replies
Allan