Vue Scheduler Dynamic Resource Filtering
Get started with this exampleUsage
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.
Dynamic Resource Filtering
Resources can be dynamically turned on and off. This will show or hide the resource and can be done runtime the same way as for any other calendar option.
Demo

Code
View code on GitHub
<script setup>
import {
getJson,
MbscCheckbox,
MbscEventcalendar,
MbscPage,
setOptions
} from '@mobiscroll/vue'
import { onMounted, ref } from 'vue'
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
})
const myEvents = ref([])
const myView = ref({
scheduler: {
type: 'week',
allDay: false,
startDay: 1,
endDay: 5,
startTime: '08:00',
endTime: '17:00'
}
})
const resources = [
{
id: 1,
name: 'Ryan',
color: '#f7c4b4'
},
{
id: 2,
name: 'Kate',
color: '#c6f1c9'
},
{
id: 3,
name: 'John',
color: '#e8d0ef'
}
]
const myResources = ref(resources)
const participants = {
1: true,
2: true,
3: true
}
function filter() {
myResources.value = resources.filter((r) => participants[r.id])
}
onMounted(() => {
getJson(
'https://trial.mobiscroll.com/resource-events-shared/',
(events) => {
myEvents.value = events
},
'jsonp'
)
})
</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"
:data="myEvents"
:resources="myResources"
:clickToCreate="true"
:dragToCreate="true"
:dragToMove="true"
:dragToResize="true"
/>
</div>
<div class="mbsc-col-sm-3">
<div class="mbsc-form-group-title">Show available tasks</div>
<MbscCheckbox label="Ryan" v-model="participants[1]" @change="filter" />
<MbscCheckbox label="Kate" v-model="participants[2]" @change="filter" />
<MbscCheckbox label="John" v-model="participants[3]" @change="filter" />
</div>
</div>
</div>
</MbscPage>
</template>
<style>
.dynamic-resources-calendar {
border-right: 1px solid #ccc;
}
</style> <script setup lang="ts">
import {
getJson,
MbscCheckbox,
MbscEventcalendar,
MbscPage,
setOptions
} from '@mobiscroll/vue'
import type { MbscCalendarEvent, MbscEventcalendarView, MbscResource } from '@mobiscroll/vue'
import { onMounted, ref } from 'vue'
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
})
const myEvents = ref<MbscCalendarEvent[]>([])
const myView = ref<MbscEventcalendarView>({
scheduler: {
type: 'week',
allDay: false,
startDay: 1,
endDay: 5,
startTime: '08:00',
endTime: '17:00'
}
})
const resources: MbscResource[] = [
{
id: 1,
name: 'Ryan',
color: '#f7c4b4'
},
{
id: 2,
name: 'Kate',
color: '#c6f1c9'
},
{
id: 3,
name: 'John',
color: '#e8d0ef'
}
]
const myResources = ref<MbscResource[]>(resources)
const participants: { [key: number]: boolean } = {
1: true,
2: true,
3: true
}
function filter() {
myResources.value = resources.filter((r) => participants[r.id as number])
}
onMounted(() => {
getJson(
'https://trial.mobiscroll.com/resource-events-shared/',
(events: MbscCalendarEvent[]) => {
myEvents.value = events
},
'jsonp'
)
})
</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"
:data="myEvents"
:resources="myResources"
:clickToCreate="true"
:dragToCreate="true"
:dragToMove="true"
:dragToResize="true"
/>
</div>
<div class="mbsc-col-sm-3">
<div class="mbsc-form-group-title">Show available tasks</div>
<MbscCheckbox label="Ryan" v-model="participants[1]" @change="filter" />
<MbscCheckbox label="Kate" v-model="participants[2]" @change="filter" />
<MbscCheckbox label="John" v-model="participants[3]" @change="filter" />
</div>
</div>
</div>
</MbscPage>
</template>
<style>
.dynamic-resources-calendar {
border-right: 1px solid #ccc;
}
</style>