jquery-calendar-bs4 icon indicating copy to clipboard operation
jquery-calendar-bs4 copied to clipboard

How do dynamically load events

Open sbsrouteur opened this issue 4 years ago • 1 comments

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?

sbsrouteur avatar Oct 29 '20 07:10 sbsrouteur

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.

davidgs avatar Jun 22 '21 13:06 davidgs