Multi-Resource Shared Events

Events can be shared among resources. This can easily be the same resource type, like people in a shared work calendar scenario or different resource types, like aircraft and instructor in a flight training scenario where you'll have to schedule an instructor and an aircraft for a class which is the event.

Shared events will render correctly in the appropriate resource columns with drag & drop, validation across invalid dates and times will work out of the box. All you need to do is to add both resourceIDs to the event.

Download and try example

Demo

Loading the live demo

Preview in full screen

Schedule event across multiple resources in the Scheduler — for shared work calendars, mixed resource types like instructor and aircraft.

Code

mobiscroll.setOptions({
  locale:  ,
  theme: ' ',
  themeVariant: ' '
});

$(function () {
  function showPopup(args) {
    var event = args.event;
    var resources = Array.isArray(event.resource) ? event.resource : [event.resource];

    // Store temporary event
    tempEvent = event;

    // Fill popup with the current event data
    $title.mobiscroll('getInst').value = event.title;

    $segmented.each(function () {
      var segmented = $(this);
      var value = +segmented.val();
      var segmentedInst = segmented.mobiscroll('getInst');
      segmentedInst.checked = resources.indexOf(value) !== -1;
    });

    // Set anchor for the popup
    popup.setOptions({ anchor: args.target ? args.target : args.domEvent.target });
    popup.open();
  }

  var tempEvent;
  var deleteEvent;
  var $title = $('#demo-shared-events-title');
  var $segmented = $('[name="demo-shared-events-select"]');

  var calendar = $('#demo-shared-events-across-resources')
    .mobiscroll()
    .eventcalendar({
      clickToCreate: true,
      dragToCreate: true,
      dragToMove: true,
      dragToResize: true,
      view: {
        scheduler: {
          type: 'week',
          allDay: false,
          startDay: 1,
          endDay: 5,
          startTime: '05:00',
          endTime: '22:00',
        },
      },
      data: [
        {
          start: '2026-10-21T10:00',
          end: '2026-10-21T15:00',
          title: 'Impact Training',
          resource: [2, 3],
          color: '#35bb5a',
        },
        {
          start: '2026-10-22T10:00',
          end: '2026-10-22T15:00',
          title: 'Impact Training',
          resource: [2, 3],
          color: '#35bb5a',
        },
        {
          start: '2026-10-24T08:30',
          end: '2026-10-24T10:00',
          title: 'Quick mtg. with Martin',
          resource: 3,
          color: '#913aa7',
        },
        {
          start: '2026-10-24T12:00',
          end: '2026-10-24T13:00',
          title: 'General orientation',
          resource: [1, 2, 3],
          color: '#a71111',
        },
        {
          start: '2026-10-25T10:00',
          end: '2026-10-25T11:00',
          title: 'Product team mtg.',
          resource: [2, 3],
          color: '#6e7f29',
        },
        {
          start: '2026-10-26T14:00',
          end: '2026-10-26T16:00',
          title: 'Stakeholder mtg.',
          resource: 1,
          color: '#dcd234',
        },
        {
          start: '2026-10-27T10:00',
          end: '2026-10-27T14:00',
          title: 'Innovation mtg.',
          resource: [1, 2],
          color: '#de3d83',
        },
      ],
      resources: [
        {
          id: 1,
          name: 'Ryan',
          color: '#f7c4b4',
        },
        {
          id: 2,
          name: 'Kate',
          color: '#c6f1c9',
        },
        {
          id: 3,
          name: 'John',
          color: '#e8d0ef',
        },
      ],
      extendDefaultEvent: function () {
        return { color: '#4a9e42' };
      },
      onEventCreated: function (args) {
        deleteEvent = true;
        showPopup(args);
      },
      onEventDoubleClick: function (args) {
        deleteEvent = false;
        showPopup(args);
      },
    })
    .mobiscroll('getInst');

  var popup = $('#demo-shared-events-popup')
    .mobiscroll()
    .popup({
      display: 'anchored',
      contentPadding: false,
      touchUi: false,
      width: 350,
      buttons: [
        'cancel',
        {
          text: 'OK',
          keyCode: 'enter',
          handler: function () {
            var selected = [];

            $segmented.each(function () {
              var segmented = $(this);
              var segmentedInst = segmented.mobiscroll('getInst');

              if (segmentedInst.checked) {
                selected.push(+segmented.val());
              }
            });

            tempEvent.resource = selected;

            deleteEvent = false;

            // Update event with the new properties on OK button click
            calendar.updateEvent(tempEvent);
            popup.close();
          },
          cssClass: 'mbsc-popup-button-primary',
        },
      ],
      onClose: function () {
        if (deleteEvent) {
          calendar.removeEvent(tempEvent);
        }
      },
    })
    .mobiscroll('getInst');

  $title.on('input', function (ev) {
    tempEvent.title = ev.target.value;
  });
});
  

Duplicate Session

You have signed in on a different machine. To keep everything in sync, you have been signed out of this session.

If you need to invite team members, manage seats and accounts you can do it from the licenses page.

Duplicate Session

We noticed you are logged in on a different machine and have closed your old session.

If you need to invite team members, manage seats and accounts you can do it from the licenses page.