删除整个FullCalendar实例

时间:2017-06-12 06:06:57

标签: fullcalendar

我想删除(不会破坏,因为这将设置默认值)一个FullCalendar实例并将其创建回来。我用:

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

在此之后,使用

重新创建日历
$('#calendar').fullCalendar({
...

没有工作。

我尝试做的是改变" slotDuration"的值。和" snapDuration"创作之后。如果有这样的方法,这对我也有帮助。没有关于此的文档。

此致

2 个答案:

答案 0 :(得分:0)

检查jsFiddle。你应该先破坏日历。

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


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

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


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

答案 1 :(得分:0)

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

Restores the element to the state before FullCalendar was initialized.