简体   繁体   中英

fullcalendar - how to render only actived resource events at agenda weekly view?

please help.

this is following my code..

i'm working fullcalendar.js library

how to render only resourceId "A" resource events at agenda weekly view?

now working all events rendered.

i want render by resourceId events

$(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 
   } 
 }
});

Maybe not quite what you're asking for, but if you define the render function as follows, it will remove all events that arent of ID "A" when it starts rendering:

$(Calendar).fullCalendar({

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

});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM