0

我将 FullCalendar 与 Backbone.JS 和 Require.js 一起使用

我的视图加载日历标题,但就是这样。只有当我按下前进或后退月份或今天按钮时,才会出现网格。我在萤火虫上收到错误消息,说 getDaySegmentContainer 未定义。

我认为这可能是因为 DOM 还没有准备好,所以一旦我完成了视图的设置,我就强制渲染,但这没有任何区别。

以下是我的代码,如果您需要查看日历视图的渲染功能,请告诉我。

主视图:

    var View = Backbone.View.extend({
        template : _.template(Template),

        initialize : function() {

            this.$el.html(_.template(Template));
            _.extend(this, Backbone.Events);
            this.collection = new EventCollection();

            //$("#calendar").append(_.template(Template));
            // $(this.el).append(_.template(Template));

            this.calendarView = new CalendarView({
                el : $(this.el).find("#calendarDiv"),
                collection : this.collection
            });
            // $(this.el).find("#calendarDiv").append(this.calendarView.el);
            this.calendarView.render();
            //this.collection.fetch();

        },

        render : function() {

            return this;
        }
    });
    return View;
});

谢谢!

4

0 回答 0