ui-calendar icon indicating copy to clipboard operation
ui-calendar copied to clipboard

Newly added Events disappears when changing month

Open pnrdk opened this issue 8 years ago • 10 comments

When I add new events to the calendar after the calendar already has been loaded, they are being added like they shall. But when I am switching the month forward and afterwards backwards, the event has disappeared. I think the same thing is happening in your demo.

What to do?

Thanks very much in advance.

pnrdk avatar Feb 20 '17 14:02 pnrdk

I have same problem.....

jhgil avatar Feb 23 '17 22:02 jhgil

Adding new events issue

When adding new events to the calendar they can disappear when switching months. To solve this add

stick: true to the event object being added to the scope.

jhgil avatar Feb 24 '17 14:02 jhgil

@jhgil Thanks very much for sharing the solution with me! It Works :-)

pnrdk avatar Feb 27 '17 06:02 pnrdk

https://fullcalendar.io/docs/event_rendering/renderEvent/

I did this in jQuery and it works. May be, this code can help someone.

var event = new Object();
event.id = 123; // unique event id;
event.title = 'some title';
event.start = new Date(2017,11,4, 00, 00);
event.end = new Date(2017,11,6,00,00);
$('#calendar').fullCalendar( 'renderEvent', event, true );
// 3rd parameter is - `stick: true`

mahfuz10 avatar Dec 05 '17 20:12 mahfuz10

guys, the thing is when my page initially is loaded all my events from the database are shown after I add an event I'm inserting into the DB removing the events then refetching works like a charm to remove duplicate data but when I press the previous and the next button the only thing that will appear is the last event rendered in the calendar all the rest are gone and I'm using stick true

eliakaram93 avatar Dec 09 '17 18:12 eliakaram93

I am adding stick: true to the event object and it all it does is disables the arrow buttons to go to next and previous months. I still want to be able to look at other months but also keep my events rendered.

Adam1210 avatar Feb 02 '18 04:02 Adam1210

Adding new events issue

When adding new events to the calendar they can disappear when switching months. To solve this add

stick: true to the event object being added to the scope.

You're the best

Mwangangi avatar Dec 04 '18 04:12 Mwangangi

@jhgil and @mahfuz10 I love you guys!

juanmarcus93 avatar Jan 25 '19 17:01 juanmarcus93

https://fullcalendar.io/docs/event_rendering/renderEvent/

I did this in jQuery and it works. May be, this code can help someone.

var event = new Object();
event.id = 123; // unique event id;
event.title = 'some title';
event.start = new Date(2017,11,4, 00, 00);
event.end = new Date(2017,11,6,00,00);
$('#calendar').fullCalendar( 'renderEvent', event, true );
// 3rd parameter is - `stick: true`

you saved my time, thanks bro.

tayfunerbilen avatar Jul 01 '19 14:07 tayfunerbilen

Confirmed that "true" for the sticky flag works. Thanks.

advancedsoftwarecanada avatar Oct 24 '19 05:10 advancedsoftwarecanada