How to remove FullCalendar events?

1

I'm using this:

eventClick: function (calEvent, jsEvent, view) {
    $('#calendar').fullCalendar('removeEvents', event.id);
},

My database has: id , title , start , end , username I tried to change "event.id" to "id" , but nothing seems to work. When I click on the event, all events are removed from the calendar, but not from the database. If I refresh the page they will appear again.

    
asked by anonymous 04.05.2015 / 15:57

2 answers

0

In case, you will have to make some calls for ajax, for example, to a controller in your php, for example:

eventClick: function (calEvent, jsEvent, view) {
    $.ajax({
        url: 'calendario.php',
        data: {'calendario_id' : event.id},
        success: function() {

            $('#calendar').fullCalendar('removeEvents', event.id);

        }
    });
},

and with that in your calendar.php that will receive the request will do the remove action from your table.

    
05.05.2015 / 19:18
0

Instead of using event.id you have to use calEvent.id or change the name 'calEvent' to event And incidentally, to remove just one event you must use 'removeEvent' in the singular, otherwise it deletes all the same.

    
15.09.2015 / 18:27