I have a fullcalendar. In my fullcalendar, I have events with an id like 030820201013-trs. Other events do not have an id that ends in 'trs'.
I would like to remove events with id that ends in 'trs'. By doing:
$ ("# calendar"). FullCalendar (' removeEvents ', [' 030820201003-trs '])
, it works. However, if I do:
$ ("# calendar"). FullCalendar (' removeEvents ', [' 030820201003-trs ',' 030820201005-trs '])
, it doesn't work.
Would you be why? And how can I delete all the events without having to loop? (Which is long enough)
Events in FullCalendar are stored as an array so there isn't really a way to remove events without having to loop through them.
You can however pass in a callback filter function to the
removeEvents
event to filter through all of events and remove the ones that end withtrs
. This function has TheEvent Object
passed in which you can get theid
from.