I have a function defined in the grid php file that reloads the grid every 2 minutes:
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.
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?
I think that a good idea is to perform some logic which tell you in which time is the last triggering. Since both commands are executed at client side you can store this in variable and perform the triggering in the desired time.