我正在更新應用程序以使用最新版本的Fullcalendar(2.2.3)。我正在使用1.6.4。將Fullcalendar更新至2.2.3後的運行時錯誤
更新到當前版本後,當fullcalendar嘗試準備檢索事件數據時,出現運行時錯誤。當它碰到下面的函數時,rangeStart和rangeEnd變量爲空,當應用.clone()方法時,會生成空引用。以下是發生錯誤的fullcalendar.js中的函數(從1401行開始)。
function _fetchEventSource(source, callback) {
var i;
var fetchers = fc.sourceFetchers;
var res;
for (i=0; i<fetchers.length; i++) {
res = fetchers[i].call(
t, // this, the Calendar object
source,
rangeStart.clone(), <== rangeStart is null and causes null reference error here
rangeEnd.clone(),
options.timezone,
callback
);
if (res === true) {
// the fetcher is in charge. made its own async request
return;
}
else if (typeof res == 'object') {
// the fetcher returned a new source. process it
_fetchEventSource(res, callback);
return;
}
}
這裏是日曆對象是如何在我看來
$('#calendar').fullCalendar({
editable: false,
eventSources: [
{
url: '@Url.Action("PullCalendarEvents")',
type: 'POST',
error: function() {
//alert('there was an error while fetching events!');
presentErrorPopup('fetch');
}
}
]
});
日曆是一個選項卡中定義。這是選中選項卡時調用來顯示日曆的行。
$('#calendar').fullCalendar('refetchEvents')
我是否需要更改定義或調用日曆對象的方式?
這純粹是JavaScript,與C#無關。我相應地更新了標籤。 – PoweredByOrange 2014-12-04 22:28:39
確實,代碼是JavaScript,但我在c#應用程序中使用它。你給了它 - 爲了那個? – mcolegro 2014-12-05 01:29:00
不,我沒有downvote。只編輯了你的標籤。 – PoweredByOrange 2014-12-05 04:49:00