Javascript FullCalendar仅删除一个事件
我的问题是,为什么这段代码不删除单个事件,而是一次删除所有事件,而触发事件是好的(id也是好的) 渲染事件时在图标上附加click事件:Javascript FullCalendar仅删除一个事件,javascript,jquery,fullcalendar,Javascript,Jquery,Fullcalendar,我的问题是,为什么这段代码不删除单个事件,而是一次删除所有事件,而触发事件是好的(id也是好的) 渲染事件时在图标上附加click事件: eventRender: function(event, element) { //console.log(event); if (event.type != "itineraire") element.find('.fc-title').append('<span class="removeEvent fa fa-trash pull
eventRender: function(event, element) {
//console.log(event);
if (event.type != "itineraire")
element.find('.fc-title').append('<span class="removeEvent fa fa-trash pull-right"></span>');
element.find(".fa-trash").click(function() {
app.removeEvent(event._id);
});
},
试试这个
removeEvent(id){
console.log("we remove id " + id);
$('#calendarContainer').fullCalendar( 'removeEvents', function(event) {
return (event._id == id);
});
}
这对我有用
removeEvent(id){
console.log("we remove id " + id);
$('#calendarContainer').fullCalendar( 'removeEvents', function(event) {
return (event._id == id);
});
}