无法将事件重新呈现为fullCalendar

Can not re render events fullCalendar

本文关键字:新呈现 fullCalendar 事件      更新时间:2023-09-26

我试图通过从服务器更新新数据来重置事件,但它不起作用,我不知道为什么。看起来一切都很好。

我先删除所有事件并添加新的源。

谢谢。

$.ajax({
    type: 'POST',
    url: '/time_slots/bulk',
    dataType: 'json',
    data: {
      time_slot: JSON.stringify(timeSlots),
      user_id: user_id
    },
    success: function(timeSlots) {
      calendar.fullCalendar('removeEvents');
      timeSlots.forEach(function(el) {
        calendar.fullCalendar('renderEvent', el);
      });
      window.currentTimeSlots = timeSlots;
    }
});

很抱歉我忘记了事件的标题,所以无法正确渲染。