search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Autorefresh not working for > 10sec

Asked by vaishali
4 months ago.

HI,

I have implemented autorefresh property, my goal is to refresh screen every after 50sec,.
But autorefresh is working for 10 sec but when I changes it to 50 it stops working.
Please help me into this.

dp.autoRefreshEnabled={true}
dp.autoRefreshInterval={20}
dp.onAutoRefresh={function()}

Comment posted by Bhavik
4 months ago.

Hi Team,

Thank you vaishali, Same thing happen for me as well.

Is there any parameter for change infinite max count?

Answer posted by Dan Letecky [DayPilot]
4 months ago.

It's important to remember that the timeout gets reset after the component is updated. Normally, this doesn't happen too often and you usually load the current data set from the server.

If you see that it doesn't get called if you set the interval to more than 10 second it suggests that you refresh the component every 10 seconds using another mechanism: e.g. you have another setInterval() in place which refreshes a text on page. In React, if you include the Scheduler and other elements in a component, everything in the component (including the Scheduler) will be updated when you update any of the elements.

The solution is to wrap the changing part in another component, like in the following tutorial:
https://code.daypilot.org/76269/react-scheduler-how-to-search-events

The max count is introduced intentionally because the auto-refresh is not an optimal solution for checking for changes. You should try to replace it with a something like WebSockets and only update the Scheduler when the server sends a change.

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.