Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete an event on FullCalendar?

I am trying to delete an event when it is being clicked.

This is what I have and I have no idea

        eventClick: function(calEvent, jsEvent, view) {

            alert('Event: ' + calEvent.title);
            alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY);
            alert('View: ' + view.name);
            alert('This needs to be deleted');

        // change the border color just for fun
        $(this).css('border-color', 'red');
        $('#calendar').fullCalendar(
            'removeEvents'
            [this] );

    },

The solution is actually here: https://fullcalendar.io/docs/event_data/removeEvents/ but I still cant follow. Please Help!

like image 308
Sof Avatar asked Oct 18 '25 22:10

Sof


1 Answers

In my code I delete event in fullcalendar in that way

$('#calendar').fullCalendar('removeEvents' , function(ev){  
    return (ev._id == calEvent._id);
})
like image 170
Pavlo Zhukov Avatar answered Oct 20 '25 12:10

Pavlo Zhukov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!