fullCalendar 清空日历数据
展开阅读全文

fullCalendar 清空数据

在使用 fullCalendar 的时候,如果你想清空日历中的所有数据,可以使用以下方法:

使用 removeEvents 方法清空事件:

$('#calendar').fullCalendar('removeEvents');

如果日历中有 resource(资源)数据,也可以清空资源:

$('#calendar').fullCalendar('removeResource');

如果你想清空所有数据,包括事件、资源和日程相关的所有设置,可以调用 destroy 方法:

$('#calendar').fullCalendar('destroy');

destroy 方法会移除日历实例,并移除所有相关的元素和事件监听器,使得该日历实例不可用。如果你想重新初始化日历,需要重新调用 fullCalendar 函数进行初始化。