Hello
I have a function defined in the grid php file that reloads the grid every 2 minutes:
1 2 3 4 5 6 7 8 9 10 11 12 |
$reloadGrid = <<<EOF function () { var intv = 120000; setTimeout(function() { var myDate = new Date(); myDate.setMinutes(myDate.getMinutes() + 5); $('#grid').trigger('reloadGrid'); },intv); } EOF; |
In my index.php file I have a jquery ajax call that performs some actions on the server side, then calls the reloadGrid function once it completes.
1 2 3 4 5 6 7 |
}).done(function(ret) { console.log(ret); $('#dialog-pending').dialog('close'); $('#grid').trigger('reloadGrid'); }); |
The problem I have caused is that I now have 2 instances of the setTimeout function which is causing the grid to reload more often than every two minutes.
Is there a way to prevent the ajax call from ‘re-implementing’ the setTimeout function in the grid.php file so that the grid will always reload after two minutes regardless of how many times the ajax call is triggered?
Regards
Ken
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top