gpt4 book ai didi

javascript - FullCalendar updateEvent 不起作用 : Cannot read property 'clone' of undefined

转载 作者:行者123 更新时间:2023-12-03 03:49:55 25 4
gpt4 key购买 nike

我正在使用 chrome、Fullcalendar 3.4.0 并尝试过 jQuery 1.11.0、2.2.4、3.2.1。我正在尝试这样,但它不起作用。请帮助我。

$('#calendar').fullCalendar({});

$('#calendar').fullCalendar('updateEvent', {
title: 'dddd',
start: '2017-07-16'
});

Uncaught TypeError: Cannot read property 'clone' of undefined

最佳答案

正如文档中提到的:https://fullcalendar.io/docs/event_data/updateEvent/

event must be the original Event Object for an event, not merely a reconstructed object. The original Event Object can obtained by callbacks such as eventClick, or by the clientEvents method.

您似乎正在向它传递一个您刚刚从无到有创建的任意对象。 FullCalendar 无法将其与日历上的现有事件匹配以更新该事件。

很难知道,因为您为问题提供的上下文太少,但如果您尝试在日历上创建事件,那么正确使用的方法是 renderEvent: https://fullcalendar.io/docs/event_rendering/renderEvent/

关于javascript - FullCalendar updateEvent 不起作用 : Cannot read property 'clone' of undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45209839/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com