1

请帮忙。

这是按照我的代码..

我正在使用 fullcalendar.js 库

如何在议程每周视图中仅呈现 resourceId“A”资源事件?

现在正在处理所有呈现的事件。

我想通过 resourceId 事件渲染

$(Calendar).fullCalendar({
 resources: [
  {
   id: "A",
   title: "R-A"
  },
  {
    id: "B",
    title: "R-B"
  }
 ],
  events: [
   {
    "id": "0", 
    "resourceId": "A"
  },{
    "id": "1", 
    "resourceId": "B"
  }
 ],
  views: {
   agendaWeekly: {
    days: 7 
   } 
 }
});
4

1 回答 1

1

可能不是您所要求的,但是如果您按如下方式定义渲染函数,它将在开始渲染时删除 ID 为“A”的所有事件:

$(Calendar).fullCalendar({

   ...
  eventRender : function(event, element,view) {
     if (event.resourceId != "A") {
        $(Calendar).fullCalendar("removeEvents",event._id);
     }
   },
  ...

});
于 2017-01-13T12:12:42.420 回答