2
I have a code that makes a query in the database (every 1 second) using the setInterval and updates a dashboard (Via AJAX and PHP) from my system, which shows the summary of all user tasks. (To give the impression to the user that it is in real time and he sees the panel change when he changes something in the system).
PROBLEM: The problem is that I have a filter and I would like that, when selecting certain companies, the panel only showed the activities of a certain company (and not all, as is done by default). Only this doesn’t happen, because the setInverval keeps running all the time.
Below I will show a system image:
I know the description was kind of generic, but if you could give me some light, I’d appreciate it.
Thank you!
The
setInterval()
returns the ID of the created timer. To stop it just use this ID as argument for the functionclearInterval
.– fernandosavio
Suddenly, inside the setInterval, let the function check what is in the client field, and update the search with the value that the user selects. To be more precise, I’d have to see the code.
– Otávio Silveira