Back to Fullcalendar

Associating Events with Resources

_docs-v3/resource-data/resources-and-events.md

latest957 B
Original Source

An Event Object becomes associated with a resource when its resourceId property matches one of the Resource Object's id fields:

js
$('#calendar').fullCalendar({
  resources: [
    {
      id: 'a',
      title: 'Room A'
    }
  ],
  events: [
    {
      id: '1',
      resourceId: 'a',
      title: 'Meeting',
      start: '2015-02-14'
    }
  ]
});

Multiple Resources

It is also possible to associate an event with multiple resources using the resourceIds property, which is an array:

js
$('#calendar').fullCalendar({
  resources: [
    {
      id: 'a',
      title: 'Room A'
    },
    {
      id: 'b',
      title: 'Room B'
    }
  ],
  events: [
    {
      id: '1',
      resourceIds: ['a', 'b'],
      title: 'Meeting',
      start: '2015-02-14'
    }
  ]
});
<div class='version-info' markdown='1'> Multiple resources-per-event are only available in Scheduler v1.2.0 and onward. </div>