Issue 1112: Adding event with source doesn't work
Status:  Done
Owner: ----
Closed:  Oct 2011
Reported by roundc...@gmail.com, Sep 13, 2011
I'm adding a new event to the calendar using 'renderEvent'. This doesn't work if the said event object has the source property set (to a valid event source object, btw).

When looking at the code, cache.push(event) is only executed if event.source is not set. Is this made on purpose or is it a bug? I'd expect any event to be added to cache before executing reportEvents().


Sep 14, 2011
Project Member #1 althaus.it
Have you read the documentation?

http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/
Status: Reproducing
Sep 14, 2011
#2 roundc...@gmail.com
I read the documentation several times but it wasn't absolutely clear to me that events having a source assigned will be rejected at all.

So do you see any possibility to accept events with source? For my application this would allow me to inject new events (from an ajax call) without refetching all events just in order to update the view. All events currently displayed have to be assigned to a source in order for removeEventSource() to behave correctly.
Sep 15, 2011
Project Member #3 althaus.it
Hmm... I'm not that deep into the internals, so only Adam can give you a clear answer on this.
Oct 2, 2011
Project Member #4 adamrs...@gmail.com
renderEvent will only render events that have been made from scratch from a fresh object. it determines this by looking at the eventObject.source property as you've found out.

right now, this is a technical limitation. as a workaround, i'd suggest keeping track of the events you want to remove via some other property, and then using the removeEvents method with a filter:
http://arshaw.com/fullcalendar/docs/event_data/removeEvents/

but for a more elegant solution, id have to think about this more. i will revisit this if another person or two has the same issue,


Status: Done