删除整个FullCalendar实例

删除整个FullCalendar实例,fullcalendar,Fullcalendar,我想删除(而不是销毁,因为这将设置默认值)一个FullCalendar实例并重新创建它。我使用: $('#calendar').html(''); 在此之后,使用重新创建日历 $('#calendar').fullCalendar({ ... 不行 我尝试这样做的是在创建后更改“slotDuration”和“snapDuration”的值。如果有这样的方法,这对我也有帮助。没有关于这个的文档 关于,请检查此项。你应该先销毁日历 $('#calendar').fullCalendar({

我想删除(而不是销毁,因为这将设置默认值)一个FullCalendar实例并重新创建它。我使用:

$('#calendar').html('');
在此之后,使用重新创建日历

$('#calendar').fullCalendar({
...
不行

我尝试这样做的是在创建后更改“slotDuration”和“snapDuration”的值。如果有这样的方法,这对我也有帮助。没有关于这个的文档

关于,请检查此项。你应该先销毁日历

$('#calendar').fullCalendar({
  defaultView: 'agendaWeek',
      weekNumbers: true
});


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

$('#calendar').html('');


$('#calendar').fullCalendar({
  defaultView: 'agendaWeek',
      weekNumbers: true
});

看起来像是销毁工作,这意味着文档声明是错误的:

Restores the element to the state before FullCalendar was initialized.

几乎可以肯定,不需要重新创建日历。您可以按此处所述设置大多数选项:似乎不需要以下选项:$('#calendar').html('';