| Issue 1366: | add an event to the current eventsource | |
| 2 people starred this issue and may be notified of changes. | Back to list |
After inserting a new event in my mysql database, i was using renderEvent in the success function of the ajaxcall to add it to the calendar. I have multiple calendar support, so i want to add the new event to the current source. I was hoping to achieve this with renderEvent, but i didn't succeed yet... I just read that there is a 'source' option in the eventobject, i tried to use an object with the url of my object, but that doesn't work... Now i use refetchEvents instead, but then there is an extra ajaxcall. Is it posibble to add an event to a source without refetching?
Aug 15, 2013
Project Member
#1
adamrs...@gmail.com
Status:
Invalid
Aug 21, 2013
I see this case is marked as invalid, but I'm also running into the same issue. What is the proper way to render a new event for a specific EventSource? My scenario is that the fullCalender is already rendering events for a specific Eventsource and then either though the back-end or through the user interface a new event is added to the specific Eventsource. How can I let fullCalendar render this new event as part of the specific EventSource without rerendering/refetching everything? TIA, P.
Aug 21, 2013
I first had a lot of trouble with that too. I 'm working on a multicalendar (a longterm project :o) But it works for me now. I can't explain how it works, it's a little magic ... You can check out my calendarcode in the downloads: http://www.paulthedutchman.nl/portfolio/?mi=113 the v2 version of my calendar has multicalendarsupport.
Oct 30, 2013
Had a look at the sourcecode. Seems like renderEvent does an explicit check if a source is specified on the Event object and if so, skips processing the event.
Seems odd to me. I'd think there would be less overhead if you could just clientside add a new event to an existing EventSource, without having to refetch all the events...
function renderEvent(event, stick) {
normalizeEvent(event);
if (!event.source) {
if (stick) {
stickySource.events.push(event);
event.source = stickySource;
}
cache.push(event);
}
reportEvents(cache);
}
|
|
| ► Sign in to add a comment |