fnReloadAjax - How to Immediately load?
fnReloadAjax - How to Immediately load?
Alex67000
Posts: 39Questions: 6Answers: 0
Hi, i'm using fnReloadAjax, it's working well ! (;
But my tbody is only loaded after the setInterval.
[code]$(document).ready(function() {
var oTable = $('#example').dataTable( {
"aoColumnDefs": [{ "sType": "string", "bSortable": false, "aTargets": [ -1 ] }],
"oLanguage": {"sSearch": "Filter:"},
"bProcessing": false,
"sAjaxSource": 'results.txt',
"bPaginate": false,
"bLengthChange": false,
"bFilter": true,
"bSort": true,
"bInfo": false,
"bAutoWidth": false
} );
var newtimer = setInterval( function () {
oTable.fnReloadAjax();
}, 15000 );
} );[/code]
I want to know if it's possible to directly load the tbody, then refresh it every setInterval ? I have tried, but ..
Thanks (:
(When i'm on the page due to a submit on another page, then redirecting to the table page with an header : location.., i have to refresh by navigator (if i don't want to wait an update for example), and it's ok, but i don't want this, and i don't understand why the header:location don't refresh by itself?)
But my tbody is only loaded after the setInterval.
[code]$(document).ready(function() {
var oTable = $('#example').dataTable( {
"aoColumnDefs": [{ "sType": "string", "bSortable": false, "aTargets": [ -1 ] }],
"oLanguage": {"sSearch": "Filter:"},
"bProcessing": false,
"sAjaxSource": 'results.txt',
"bPaginate": false,
"bLengthChange": false,
"bFilter": true,
"bSort": true,
"bInfo": false,
"bAutoWidth": false
} );
var newtimer = setInterval( function () {
oTable.fnReloadAjax();
}, 15000 );
} );[/code]
I want to know if it's possible to directly load the tbody, then refresh it every setInterval ? I have tried, but ..
Thanks (:
(When i'm on the page due to a submit on another page, then redirecting to the table page with an header : location.., i have to refresh by navigator (if i don't want to wait an update for example), and it's ok, but i don't want this, and i don't understand why the header:location don't refresh by itself?)
This discussion has been closed.
Replies
Allan
I can"t give you a link for the moment ... but i've done some tests. And indeed the problem is caused by the redirection in PHP. If i go to the page with a link, or with a submit form, the data are loaded immediately.
Page Check Form : (if all ok then header('Location: pageDatatables')
redirection to :
pageDatatables
ok
but
refreshement
not ok
(must do F5).
I think it's an not usual problem. But i don't understand. Maybe header:location, is just a strict redirection?
Allan
I was executing (creation, overwrite of the json file after executing the table).
Sometimes .... i'm..
Sorry for disarrangement allan. And a big thanks for your datatables! So goood!
Allan