通过JS类进行全日历自定义视图会破坏抛出错误

时间:2018-10-25 09:34:57

标签: angularjs fullcalendar fullcalendar-scheduler fullcalendar-3

我已经通过引用文档Custom Views via JS classes实现了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方法的任何线索吗?

0 个答案:

没有答案