0
我使用full calendar plugin V3。问题是,当我指定参数时,removeEventSource函数不起作用。我试图把标识,URL作为参数应用,并使用refetchEvents但没有运气。完整的日历插件不删除事件
$('#calendar').fullCalendar('removeEventSource'); //working without parameters
$('#calendar').fullCalendar('removeEventSource', 1); //does not work
阵列:
var events = [
{ id: 1,
title: 'dinner',
start: '2016-09-14',
end: '2016-09-14'
},
{ id: 2,
title: 'All Day Event',
start: '2016-09-10',
end: '2016-09-10'
},
{ id: 3,
title: 'Long Event',
start: '2016-09-10',
end: '2016-09-10'
},
{ id: 4,
title: 'Repeating Event',
start: '2016-09-09T16:00:00',
end: '2016-09-09'
}
]
intilize日历
var calender = $('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
defaultDate: '2016-09-12',
navLinks: true,
selectable: true,
droppable: true,
selectHelper: true,
select: function(start, end) {
var title = prompt('Event Title:');
var eventData;
if (title) {
eventData = {
title: title,
start: start,
end: end
};
$('#calendar').fullCalendar('renderEvent', eventData, true);
}
$('#calendar').fullCalendar('unselect');
},
drop: function() {
if ($('#drop-remove').is(':checked')) {
$(this).remove();
}
}
,
editable: true,
eventLimit: true,
events : events
});
点击事件
$('body').on('click','.fc-close',function(e){
//alert('remove event');
$('#calendar').fullCalendar('removeEventSource', 1);
$('#calendar').fullCalendar('refetchEvents');
});
感谢,它的工作。 – nemrrached