FullCalendar: remove events on button click

I am trying to remove a dynamically selected event from FullCalendar.

enter image description here

when this event is rendered it will be also displayed in the table with a delete button at the end of every row. enter image description here

what i want to do is when I click the delete button, it will also delete the event on the calendar. I can remove the row from the table but not in the calendar.

here is my code for selecting the event

var eventID = 0;
    select: function(start, end, event, view, resource) {
            if(start.isBefore(moment())) {
                swal('Ooops!','You cannot select past date/time!','error')
                $('#end_time').val(moment(end).format("hh:mm A"));
                $('#start_time').val(moment(start).format("hh:mm A"));
                    show : true,
                    backdrop: 'static',
                    keyboard: false
                eventData = {
                    id: eventID +1,
                    title: 'Lesson Schedule',
                    start: start,
                    end: end,
            $(".fc-highlight").css("background", "red");

    events: obj,
    eventRender:function( ev, element ) { 
        $('#sched_data').append('<tr class="tb-row">'+
            '<td>'+moment(ev.start).format('MMM. DD, YYYY')+'</td>'+
            '<td>'+moment(ev.start).format('hh:mm A')+'</td>'+
            '<td>'+moment(ev.end).format('hh:mm A')+'</td>'+
            '<td><button class="btn btn-danger btn-del btn-xs" data-id"'+ev._id+'"><i class="fa fa-times"></i></button></td></tr>'


here's the code for rendering the event to calendar

        $('.calendar').fullCalendar('renderEvent', eventData, true);


and here's my code for deleting an event

    $('.calendar').fullCalendar('removeEvents', $(this).data('id'));


  • I already did it,

    My code:

        $('.calendar').fullCalendar('removeEvents', $(this).data('id'));

    What it should be

        var del_btn = $(this);
        $(".calendar").fullCalendar('removeEvents', function(event) {
            return =='id');

    the second parameter should be a function and not just the plain id.