jquery-calendar-bs4
jquery-calendar-bs4 copied to clipboard
How do dynamically load events
Hi,
I am trying to get the calendar to load events according to the current visible timespan. I hooked the calendar.init event. However, since setting events requires an init to display this create a loop. How is one supposed to avoid the infinite loop?
I used a state variable to avoid looping, but it feels awkward. Is there a "CalendarViewChanged" event I missed that allows setting events and initing?
Calendar.init When
- View changes (day, week or month)
- View moves (left or right)
- Manually called by you
And inside the init() function you check what the view is using getView()
and check if it changed.