Vue Scheduler 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.

Get started with this 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

<script setup>
import {
  MbscEventcalendar,
  MbscInput,
  MbscPopup,
  MbscSegmented,
  MbscSegmentedGroup,
  setOptions 
} from '@mobiscroll/vue'
import { ref } from 'vue'

setOptions({
  locale:  ,
  theme: ' ',
  themeVariant: ' '
})

const myEvents = ref([
  {
    start: '2026-11-06T10:00',
    end: '2026-11-06T15:00',
    title: 'Impact Training',
    resource: [2, 3],
    color: '#35bb5a'
  },
  {
    start: '2026-11-07T10:00',
    end: '2026-11-07T15:00',
    title: 'Impact Training',
    resource: [2, 3],
    color: '#35bb5a'
  },
  {
    start: '2026-11-09T08:30',
    end: '2026-11-09T10:00',
    title: 'Quick mtg. with Martin',
    resource: 3,
    color: '#913aa7'
  },
  {
    start: '2026-11-09T12:00',
    end: '2026-11-09T13:00',
    title: 'General orientation',
    resource: [1, 2, 3],
    color: '#a71111'
  },
  {
    start: '2026-11-10T10:00',
    end: '2026-11-10T11:00',
    title: 'Product team mtg.',
    resource: [2, 3],
    color: '#6e7f29'
  },
  {
    start: '2026-11-11T14:00',
    end: '2026-11-11T16:00',
    title: 'Stakeholder mtg.',
    resource: 1,
    color: '#dcd234'
  },
  {
    start: '2026-11-12T10:00',
    end: '2026-11-12T14:00',
    title: 'Innovation mtg.',
    resource: [1, 2],
    color: '#de3d83'
  }
])

const myResources = [
  {
    id: 1,
    name: 'Ryan',
    color: '#f7c4b4'
  },
  {
    id: 2,
    name: 'Kate',
    color: '#c6f1c9'
  },
  {
    id: 3,
    name: 'John',
    color: '#e8d0ef'
  }
]

const myView = {
  scheduler: {
    type: 'week',
    allDay: false,
    startDay: 1,
    endDay: 5,
    startTime: '05:00',
    endTime: '22:00'
  }
}

const tempEvent = ref({})
const participants = ref([])
const isNewEvent = ref(false)
const isPopupOpen = ref(false)
const popupAnchor = ref(null)
const title = ref('')

const popupButtons = [
  'cancel',
  {
    text: 'OK',
    keyCode: 'enter',
    handler: () => {
      tempEvent.value.resource = participants.value
      tempEvent.value.title = title.value

      if (isNewEvent.value) {
        myEvents.value = [...myEvents.value, tempEvent.value]
      } else {
        myEvents.value = [...myEvents.value]
      }
      isNewEvent.value = false
      isPopupOpen.value = false
    },
    cssClass: 'mbsc-popup-button-primary'
  }
]

function showPopup(args) {
  setTimeout(() => {
    const event = args.event
    const resources = Array.isArray(event.resource) ? event.resource : [event.resource]

    // Store temporary event
    tempEvent.value = event

    // Fill popup with the current event data
    title.value = event.title
    participants.value = resources

    // Set anchor for the popup
    popupAnchor.value = args.target ? args.target : args.domEvent.target
    isPopupOpen.value = true
  })
}

function handleEventCreated(args) {
  isNewEvent.value = true
  showPopup(args)
}

function handleEventDoubleClick(args) {
  isNewEvent.value = false
  showPopup(args)
}

function myDefaultEvent() {
  return { color: '#4a9e42' }
}

function handlePopupClose() {
  if (isNewEvent.value) {
    myEvents.value = myEvents.value.filter((item) => item.id !== tempEvent.value.id)
  }
  isPopupOpen.value = false
}
</script>

<template>
  <MbscEventcalendar
    :clickToCreate="true"
    :dragToCreate="true"
    :dragToMove="true"
    :dragToResize="true"
    :view="myView"
    :data="myEvents"
    :resources="myResources"
    :extendDefaultEvent="myDefaultEvent"
    @event-double-click="handleEventDoubleClick"
    @event-created="handleEventCreated"
  />
  <MbscPopup
    display="anchored"
    :anchor="popupAnchor"
    :buttons="popupButtons"
    :contentPadding="false"
    :touchUi="false"
    :width="350"
    :isOpen="isPopupOpen"
    @close="handlePopupClose"
  >
    <div class="mbsc-form-group">
      <MbscInput v-model="title" label="Title" input-style="box" label-style="stacked" />
      <div class="mbsc-padding">
        <label class="mbsc-txt-muted">Select event participants</label>
      </div>
      <MbscSegmentedGroup select="multiple" v-model="participants">
        <MbscSegmented :value="1">Ryan</MbscSegmented>
        <MbscSegmented :value="2">Kate</MbscSegmented>
        <MbscSegmented :value="3">John</MbscSegmented>
      </MbscSegmentedGroup>
    </div>
  </MbscPopup>
</template>

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.