首页 > 解决方案 > 通过 JS 类销毁的 Fullcalendar 自定义视图会引发错误

问题描述

我已经通过 JS 类引用文档自定义视图来实现 Fullcalendar 自定义视图。它似乎工作正常,但该destroy方法引发错误:View.prototype.destroy.apply is not function.

我使用了以下代码:

var FC = $.fullCalendar;
var View = FC.View;
var BlankView;

BlankView = View.extend({
    initialize: function() {
       // View.prototype.initialize.apply(this, arguments);
    },
    setHeight: function(height, isAuto) {
    },
    render: function () {
        this.title = this.title || 'TestView';
        if (this.el[0].children.length === 0) this.el.addClass('fc-basic-view').html(this.renderHtml());
    },
    destroyEvents: function() {
        // responsible for undoing everything in renderEvents
    },
    destroy: function() {
         View.prototype.destroy.apply(this, arguments);
    },
    renderHtml: function () {
        this.el.html('<div></div>');
    },



});

FC.views.blank = BlankView;

destroy在自定义视图中实现该方法的任何线索?

标签: angularjsfullcalendarfullcalendar-schedulerfullcalendar-3

解决方案


推荐阅读