2016-11-26 39 views
0

我在我的流星應用程序中使用完整日曆。對於響應式設計,我希望它切換到較小屏幕尺寸的列表視圖。更改爲列表視圖給我以下錯誤:fullcalendar listview failed

Exception from Tracker afterFlush function 
TypeError: spec.class is not a constructor 
at Calendar_constructor.instantiateView (fullcalendar_fullcalendar.js?hash=19f7a11…:9324) 
at renderView (fullcalendar_fullcalendar.js?hash=19f7a11…:9739) 
at initialRender (fullcalendar_fullcalendar.js?hash=19f7a11…:9676) 
at Calendar_constructor.render (fullcalendar_fullcalendar.js?hash=19f7a11…:9644) 
at HTMLDivElement.<anonymous> (fullcalendar_fullcalendar.js?hash=19f7a11…:87) 
at Function.each (jquery.js?hash=c57b3cf…:442) 
at jQuery.fn.init.each (jquery.js?hash=c57b3cf…:194) 
at jQuery.fn.init.$.fn.fullCalendar (fullcalendar_fullcalendar.js?hash=19f7a11…:66) 
at Blaze.TemplateInstance.<anonymous> (calendar.js:90) 
at blaze.js?hash=983d07a…:3341 

'agendaweek'視圖和其他工作就像一個魅力。只是列表視圖沒有。

這裏是一個最小的例子。我使用流星1.4.2.3,並且在流星創建後只添加了fullcalendar:fullcalendar軟件包。

main.html中

<head> 
    <title>testFC</title> 
</head> 
<body> 
    <h1>Welcome to Meteor!</h1> 
    {{> calendar}} 
</body> 

calendar.html

<template name="calendar"> 
    <div id="events-calendar"></div> 
</template> 

calendar.js

let options = { 
    firstDay: 1, 
    defaultView: 'listWeek', 
} 
Template.calendar.onRendered(() => { 
    $('#events-calendar').fullCalendar(options); 
}); 

可能是什麼問題呢? 非常感謝您的幫助 best s。

回答

0

From documentation:

Only days with events are displayed. If there are no events during a specific interval of time, the noEventsMessage is displayed.

從你的代碼,它看起來像你既沒有事件,也不是 「noEventMessage」。