我们有一个刷新按钮,在刷新时我们必须清除eventSources数组并用新数据填充它。 这是原始事件数组。
this.calEvents = [
{ title: 'All Day Event', start: new Date(y, m, 1) },
{ title: 'Long Event', start: new Date(y, m, d - 5), end: new Date(y, m, d - 2) },
{ id: 999, title: 'Repeating Event', start: new Date(y, m, d - 3, 16, 0), allDay: false },
{ id: 999, title: 'Repeating Event', start: new Date(y, m, d + 4, 16, 0), allDay: false },
{ title: 'Birthday Party', start: new Date(y, m, d + 1, 19, 0), end: new Date(y, m, d + 1, 22, 30), allDay: false },
{ title: 'Click for Google', start: new Date(y, m, 28), end: new Date(y, m, 29), url: 'http://google.com/' }
];
this.eventSources = [this.calEvents];
是按钮点击时刷新fullcalendar的代码,
var eventSources = this.calEvents.map((event) => {
return {
title: event.title,
start: event.start
}
});
this.uiCalendarConfig.calendars['myCalendar'].fullCalendar('removeEvents')
this.uiCalendarConfig.calendars['myCalendar'].fullCalendar('addEventSource', eventSources);
this.uiCalendarConfig.calendars['myCalendar'].fullCalendar('refetchEvents');
以上代码适用于Chrome,但在IE 11中无效。
是否有单独的API来刷新IE中的数据?