Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Fullcalendar refetchevents未获取新事件_Fullcalendar - Fatal编程技术网

Fullcalendar refetchevents未获取新事件

Fullcalendar refetchevents未获取新事件,fullcalendar,Fullcalendar,我使用函数获取我的事件: 事件:函数(开始、结束、时区、回调){ $.ajax({ url:“/Controller/GetDiaryEvents/”, 数据:{无需重新读取所有事件 创建新事件后,使用函数将其添加到日历中 $("#calendar").fullCalendar( 'addEventSource', source ); 源可以是一个数组/URL/函数,就像在事件选项中一样。事件将立即从此源获取并放置在日历上 只需添加一个函数getEvents(),并在要重新蚀刻的位置调用它

我使用函数获取我的事件:

事件:函数(开始、结束、时区、回调){
$.ajax({
url:“/Controller/GetDiaryEvents/”,

数据:{
无需重新读取所有事件

创建新事件后,使用函数将其添加到日历中

$("#calendar").fullCalendar( 'addEventSource', source );
源可以是一个数组/URL/函数,就像在事件选项中一样。事件将立即从此源获取并放置在日历上


只需添加一个函数getEvents(),并在要重新蚀刻的位置调用它

function getEvents()
{
    $('#calendar').fullCalendar( 'refetchEvents' );
}

根据您显示的代码,没有理由不工作。您是否已验证事件是否确实正确存储在数据库中?调用“refetchEvents”是否一定要触发ajax调用以获取事件,否则控制台中会出现错误吗?如果它获取事件,响应是否包含新事件?使用浏览器工具和数据库GUI进行一些基本调试。