为什么函数getEventSourceById(id)返回null?

时间:2019-07-10 20:22:24

标签: fullcalendar

我的目标是向事件添加CSS类。为此,我想在事件上使用addClass函数。 因此,我需要一个对象EventApi,为此,我使用函数getEventSourceById并给出一个ID,以获取要在其中添加类的事件。

但是函数getEventSourceById(eventId)返回null。 我检查了事件的id和参数中的eventId,这应该返回一些东西。

(创建事件时,由于属性“ id”,我会影响id。)

谢谢您的回答。 ;)

for(oItem of this.calendar.getEvents()) {
var sReq = "/AttendanceSet('" + oItem.id + "')";
var sPeriod = "FullDay";
if (sPeriod === "FullDay") {
    debugger;            
    this.calendar.getEventSourceById(oItem.id).addClass("fc-event- 
    fullDay");
    }
}
  

未捕获的TypeError:this.calendar.getEventSourceById(...)。addClass是   不是功能

0 个答案:

没有答案