3

I have implemented Fullcalendar Custom View by referring document Custom Views via JS classes. It seems to worki fine, but the destroy method throws an error: View.prototype.destroy.apply is not function.

I have used the below code:

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;

Any clues to achieve the destroy method in custom views?

Robert
  • 3,373
  • 1
  • 18
  • 34

0 Answers0