Drag-and-Drop Task Presets
Usage
theme: 'ios' You can turn auto theming on and let it decide based on the platform.
Usage
themeVariant: 'light' You can turn auto dark mode on based on system settings.
Usage
clickToCreate: true,
// click to create is on dragToCreate: true,
// drag to create is on dragToMove: true,
// reordering is on dragToResize: true,
// resizing is on eventDelete: true
// deleting is on Fine-tune drag & drop with these options, which are false by default.
Usage
locale: localeEn Selecting the locale loads the localized settings and the translated UI text.
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.
Demo
The live demo didn't load.
Try it on demo.mobiscroll.com
Code
View code on GitHub
<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> <script setup lang="ts">
import {
MbscDraggable,
MbscEventcalendar,
MbscInput,
MbscPage,
MbscPopup,
MbscSelect,
MbscTextarea,
MbscToast,
setOptions
} from '@mobiscroll/vue'
import type {
MbscCalendarEvent,
MbscEventcalendarView,
MbscEventCreatedEvent
} from '@mobiscroll/vue'
import { ref } from 'vue'
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
})
const myTasks = ref<MbscCalendarEvent[]>([
{
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: MbscEventcalendarView = {
calendar: { labels: true }
}
const myInvalid = [
{
recurring: {
repeat: 'weekly',
weekDays: 'SA,SU'
}
}
]
const dragElements = ref<any>([])
const title = ref<string>('')
const details = ref<string>('')
const technician = ref<string>('')
const popupAnchor = ref<any>(null)
const isPopupOpen = ref<boolean>(false)
const toastMessage = ref<string>('')
const isToastOpen = ref<boolean>(false)
function fillDialog(args: any) {
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: MbscEventCreatedEvent) {
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: any) {
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>