Enable to refresh event w/o re-redering page
Opened this issue · 0 comments
rolljee commented
Hey there, running througth some troubles...
Template.agenda.helpers({
options() {
let events = Events.findOne() && Events.findOne().events;
let calendar = {
titleFormat: 'MMM D YYYY',
header: {
left: 'prev',
center: 'title',
right: 'today ,next'
},
defaultView: 'month',
events: events,
eventClick: function (calEvent, jsEvent, view) {
Session.set('eventId', calEvent._id);
Modal.show('editevent');
},
eventDrop: function (event, delta, revertFunc) {
Meteor.call('events.update', {
title: event.title,
_id: event._id,
start: event._start._d,
end: event._end._d
});
},
dayClick: function (date, jsEvent, view) {
Session.set('clicked-date', date._d);
Modal.show('addnew');
}
};
$('#calendar').fullCalendar('refetchEvents'); // using this perfom absolutly nothing
return calendar
},
});`
<template name="agenda">
{{#if Template.subscriptionsReady}} {{> fullcalendar options id="calendar" }} {{else}} {{> spinner}} {{/if}}
</template>
Also, when i add a new event, i perform :
$('#calendar').fullCalendar('renderEvent', result);
Somehow, template doesn't update until i refresh manualy the page.. anyone encouring the same problem ?