Drag-and-Drop Task Presets

Use external draggable events to create preset tasks that people can quickly copy and spawn events from. A great example is a car wrapping shop where different jobs need to be set up depending on the type of vehicle.

Print a list of predefined tasks and initialize them as draggable elements. Enable externalDrop for the calendar and set up the predefined event skeletons for the draggable component.

Whenever there is more information to be captured, like detailed task notes, customer information, the name of the technician... you can trigger a popup with the task form in the event-create lifecycle event. For failed drops (trying to schedule a task during lunch breaks or weekends) the event-create-failed event will be triggered.

Want to see how external presets look & feel for a scheduler?  Check out this example →
Get started with this example

Demo

Loading the live demo

Preview in full screen

Drag preset task templates from an external list onto a event calendar — a popup form captures task details and technician at drop time.

Code

<script setup>
import {
  MbscDraggable,
  MbscEventcalendar,
  MbscInput,
  MbscPage,
  MbscPopup,
  MbscSelect,
  MbscTextarea,
  MbscToast,
  setOptions 
} from '@mobiscroll/vue'
import { ref } from 'vue'

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

const myTasks = ref([
  {
    title: 'Small wrap',
    color: '#637e57',
    start: '2026-10-25T00:00',
    end: '2026-10-26T00:00',
    length: '2 days'
  },
  {
    title: 'Full-size wrap',
    color: '#50789d',
    start: '2026-10-25T00:00',
    end: '2026-10-27T00:00',
    length: '3 days'
  },
  {
    title: 'Mid-size wrap',
    color: '#6c5d45',
    start: '2026-10-25T00:00',
    end: '2026-10-27T00:00',
    length: '3 days'
  },
  {
    title: 'Roadster wrap',
    color: '#9da721',
    start: '2026-10-25T00:00',
    end: '2026-10-27T00:00',
    length: '3 days'
  },
  {
    title: 'SUV wrap',
    color: '#cd6957',
    start: '2026-10-25T00:00',
    end: '2026-10-28T00:00',
    length: '4 days'
  },
  {
    title: 'Hypercar wrap',
    color: '#7a5886',
    start: '2026-10-25T00:00',
    end: '2026-10-29T00:00',
    length: '5 days'
  }
])

const myData = ref([
  { value: '1', text: 'Roly Chester' },
  { value: '2', text: 'Tucker Wayne' },
  { value: '3', text: 'Baker Brielle' },
  { value: '4', text: 'Jami Walter' },
  { value: '5', text: 'Patrick Toby' },
  { value: '6', text: 'Tranter Logan' },
  { value: '7', text: 'Payton Sinclair' }
])

const myView = {
  calendar: { labels: true }
}

const myInvalid = [
  {
    recurring: {
      repeat: 'weekly',
      weekDays: 'SA,SU'
    }
  }
]

const dragElements = ref([])
const title = ref('')
const details = ref('')
const technician = ref('')
const popupAnchor = ref(null)
const isPopupOpen = ref(false)
const toastMessage = ref('')
const isToastOpen = ref(false)

function fillDialog(args) {
  const event = args.event
  title.value = event.title
  details.value = event.details
  technician.value = event.technician
  popupAnchor.value = args.target
  isPopupOpen.value = true
}

function handleEventCreated(args) {
  fillDialog(args)
}

function handleEventCreateFailed() {
  toastMessage.value = "Can't create event on this date"
  isToastOpen.value = true
}

function handleEventUpdateFailed() {
  toastMessage.value = "Can't add event on this date"
  isToastOpen.value = true
}

function handlePopupClose() {
  isPopupOpen.value = false
  toastMessage.value = 'New task added'
  isToastOpen.value = true
}

function handleSelectChange(event) {
  technician.value = event.value
}

function handleToastClose() {
  isToastOpen.value = false
}
</script>

<template>
  <MbscPage>
    <div class="mbsc-grid mbsc-no-padding">
      <div class="mbsc-row">
        <div class="mbsc-col-sm-9 external-event-calendar">
          <MbscEventcalendar
            :view="myView"
            :invalid="myInvalid"
            :dragToMove="true"
            :externalDrop="true"
            @event-created="handleEventCreated"
            @event-create-failed="handleEventCreateFailed"
            @event-update-failed="handleEventUpdateFailed"
          />
        </div>
        <div class="mbsc-col-sm-3">
          <div class="mbsc-form-group-title">Available tasks</div>
          <div v-for="(task, i) in myTasks" :key="task.id">
            <div ref="dragElements" class="external-event-task" :style="{ background: task.color }">
              <div>{{ task.title }}</div>
              <div>{{ task.length }}</div>
              <MbscDraggable :element="dragElements[i]" :dragData="task" />
            </div>
          </div>
        </div>
        <MbscPopup
          display="anchored"
          headerText="Assign task"
          :width="400"
          :contentPadding="false"
          :touchUi="false"
          :buttons="['ok']"
          :anchor="popupAnchor"
          :isOpen="isPopupOpen"
          @close="handlePopupClose"
        >
          <div class="mbsc-form-group">
            <MbscInput label="Task" :defaultValue="title" readOnly></MbscInput>
            <MbscTextarea
              label="Details"
              :defaultValue="details"
              placeholder="Add description..."
            ></MbscTextarea>
            <MbscSelect
              display="anchored"
              label="Technician"
              placeholder="Please select..."
              :data="myData"
              :value="technician"
              :touchUi="false"
              @change="handleSelectChange"
            />
          </div>
        </MbscPopup>
      </div>
      <MbscToast :message="toastMessage" :isOpen="isToastOpen" @close="handleToastClose" />
    </div>
  </MbscPage>
</template>

<style>
.external-event-calendar {
  border-right: 1px solid #ccc;
}

.external-event-task {
  color: #fff;
  padding: 10px;
  margin: 20px;
  border-radius: 8px;
  font-family:
    -apple-system,
    Segoe UI,
    Roboto,
    sans-serif;
}

.demo-external-event-presets.demo-wrapper,
.demo-external-event-presets .mbsc-grid,
.demo-external-event-presets .mbsc-row,
.demo-external-event-presets .external-event-calendar {
  height: 100%;
}
</style>

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.