【问题标题】:Fullcalendar Scheduler, When creating new event does not update the calendarFullcalendar Scheduler,创建新事件时不更新日历
【发布时间】:2019-09-23 19:00:29
【问题描述】:

我正在为投影仪创建预订,在开发过程中,我被困在这里,每次拖动新事件时,它都不会在日历视图中创建新事件。我尝试提醒值并正确检索它,只有日历没有更新。 Fullcalendar + Scheduler 在互联网上的资源有限,所以我尝试在这里询问。有人知道缺少什么或应该做什么吗?

select: function(info) 
   {

       this.title = prompt('Event Title:');

       if (this.title) {

           this.eventData = {
               title: this.title,
               start: info.start,
               end: info.end,
               resourceId: info.resource.id // Example  of resource ID
           };

             $('#calendar').fullCalendar('renderEvent', this.eventData, true); // stick? = true
       }
       $('#calendar').fullCalendar('unselect');
       alert('selected ' + info.start + ' to ' + info.endStr + 'wew ' + info.resource.id);
   },

【问题讨论】:

  • 您使用的是哪个版本的 fullCalendar?你的一些语法是按照 v4 的,有些是按照 V3 的......但它们非常不同,你不能将两者混合使用。你检查过你的控制台有没有错误?
  • 版本 4.1 先生。到目前为止,没有控制台错误,只是它没有更新日历视图中的事件
  • 谢谢先生,我容易忘记 V3 和 V4 的语法是不同的,只是迁移到纯 v4 代码并添加 .addEvent 方法,现在问题已解决。谢谢

标签: fullcalendar fullcalendar-scheduler fullcalendar-4


【解决方案1】:

刚刚迁移到纯 V4,删除 V3 语法并包含 .addEvent 函数。问题解决了!

【讨论】:

  • 它可能对其他阅读本文且有类似问题的人有用,以准确显示您所做的更改。这将使答案值得一票......
【解决方案2】:
calendar.addEvent({
                        id: NewEventID, resourceId: info.resource.id, start: info.startStr, end: info.endStr, title: Title2
                    });

这是我忘记做的事情,然后使用 calendar.refetchEvents(); 重新获取事件。问题解决了!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-02-12
    • 2023-04-08
    • 2020-07-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多