meteor-fullcalendar icon indicating copy to clipboard operation
meteor-fullcalendar copied to clipboard

Enable to refresh event w/o re-redering page

Open rolljee opened this issue 8 years ago • 0 comments

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 ?

rolljee avatar Sep 25 '16 17:09 rolljee