Redraw on drawCallback?
Redraw on drawCallback?
morissette
Posts: 16Questions: 4Answers: 1
mainTable = $("#main_dash").dataTable({
"language": {
"url": "../locale/" + locale + "/LC_MESSAGES/" + "dt." + locale + ".txt",
},
"pagingType": "full_numbers",
"pageLength": 10,
"processing": true,
"ajax": {
"url": "ajax_tables/main_table.php",
"type": "POST"
},
"columnDefs": [
{ "orderable": false, "targets": 0 }
],
"columns": [
{"data": "flagged"},
{"data": "date"},
{"data": "type"},
{"data": "regarding"},
{"data": "submitted_by"},
{"data": "review"},
{"data": "assign"},
],
"autoWidth":false,
"order": [[1, 'asc']],
"deferRender": true,
"drawCallback": function() {
setTimeout(function() {
}, 20000);
},
});
How do I redraw?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Actually I don't think I want to redraw I want to update the data in the table... anything that can be done without the API?
Trying:
I went with that, but this only refreshes after the first time, how do I reload every 5 seconds always?
I used setInterval instead of setTimeout. This is resolved
Nicely done -
setInterval
is the way to do it. It can also be cancelled withclearInterval
if you ever need to.Allan