jqueryfullcalendarfullcalendar-2

How do you delete an object event source in fullcalendar?


I have added a event source as such:

$('#calendar').fullCalendar('addEventSource', function(start, end, timezone, callback) {
        getInactive(start, end, timezone, callback);
        });         
}

the events inside that have id:0

If I do .fullCalendar(removeEvent, 1) -- it removes data only from existing view and then if we browse back to it, it is already read.

Thus the source object needs to be removed, but we never specified a source id? I've tried sending the same data again with removeEventSource and it didn't quite work. I need help removing all instances of this object that is dynamically created. Thanks,


Solution

  •         //delete
            $this.$modal.find('.delete-event').show().end().find('.save-event').hide().end().find('.modal-body').empty().prepend(form).end().find('.delete-event').click(function () {
                $this.$calendarObj.fullCalendar('removeEvents', function (ev) {
                    return (ev._id == calEvent._id);
                });
    
    
                 $.ajax({
                     url : 'index.php',
                     data: 'action=delete&id='+calEvent.id,
                     type: "POST",
                 });
    
            });