vkurko / calendar

Full-sized drag & drop JavaScript event calendar with resource & timeline views
https://vkurko.github.io/calendar/
MIT License
1.23k stars 108 forks source link

refetchEvents problem #171

Closed hmzxpcm closed 1 year ago

hmzxpcm commented 1 year ago

I am trying to add an event in a second and call refetchEvents, but the calendar is not updated. Tell me what I'm doing wrong?

https://jsbin.com/liluceviba/edit?js,console,output

vkurko commented 1 year ago

refetchEvents only works in conjunction with eventSources. In your case, try using the addEvent method.

hmzxpcm commented 1 year ago

in my case, I need to update a lot of events, EventSource judging by the description does not suit me, there is a chance that you add a method to update all events

vkurko commented 1 year ago

Ok. What about ec.setOption('events', newEventsArray)?

hmzxpcm commented 1 year ago

it works, thanks!