Перейти к основному содержимому

Using DHTMLX Scheduler Properties in VueScheduler

This page documents the public Vue wrapper surface for @dhtmlx/trial-vue-scheduler and @dhx/vue-scheduler.

Use it as a reference after Overview or Quick Start.

Available Props

PropTypeDescription
eventsArray<Event | SerializedEvent>Event collection rendered in the scheduler.
view"day" \| "week" \| "month" \| "year" \| ...Active Scheduler view.
dateDate | stringActive date used to render the selected view.
markersMarker[]Time markers (for example, non-working time blocks).
pluginsSchedulerPluginsEnables Scheduler plugins such as recurring, collision, timeline, units, tooltip, quick_info, etc. Pass as { recurring: true, collision: true }.
dataVueSchedulerDataConfig | nullData loading and change handling callbacks/URLs.
localestring | Record&lt;string, any&gt;Locale name or locale object. Defaults to "en".
themestringSkin name. Active skin: "terrace" (default)
templatesRecord<string, Function>Merged into scheduler.templates.
configSchedulerConfigMerged into scheduler.config.
xySchedulerXYUI sizing settings (for example, hiding built-in nav with nav_height: 0).
filter(event: Event) => booleanFilters events displayed in Scheduler.
modalsSchedulerModals | nullOverrides built-in delete confirmation dialogs.
eventBoxRendererEventBoxRenderer | nullCustom renderer for the event box element.
viewsSchedulerViewsPropRegisters configurations for the available views. Use TimelineViewConfig, UnitsViewConfig, or GridViewConfig shapes.
customLightboxComponent | nullCustom Vue event editor component.
templateWrapper(node: VNode) => VNodeWraps template Vue elements with app-level providers (for example, a ThemeProvider) to avoid flicker during server-side render.
on<EventName> listeners(...args) => anyVue listener props mapped to Scheduler events, for example :onBeforeLightbox or :onViewChange.

Data Collections And Synchronization

Use events props when Vue state is your source of truth:

<VueScheduler
:events="events"
/>

Sync behavior summary:

  • events updates are usually diff-based
  • the wrapper can switch to reset/re-parse for large changes

For model selection and callback strategy, see Data Binding and State Management Basics.

Config, Templates, Plugins, Theme, Locale

Use these props for Scheduler setup without imperative API calls.

<script setup lang="ts">
const config: SchedulerConfig = {
first_hour: 6,
last_hour: 22
};

const templates = {
event_text: (_start: Date, _end: Date, event: Event) => `#${event.id}: ${event.text}`
};
</script>

<template>
<VueScheduler
:config="config"
:templates="templates"
theme="terrace"
locale="en"
/>
</template>

Events, Lifecycle, And Instance Access

on<EventName>

Use Vue on<EventName> listener props for Scheduler events:

<script>
...
function beforeLightbox(eventId: string | number) {
// your custom code here
const event = schedulerRef.value?.instance?.getEvent(eventId);
if (event?.$new) {
return handleEventCreated(event);
}
return handleEditEvent(eventId);
}
...
</script>


<VueScheduler
:events="events"
:onBeforeLightbox="beforeLightbox"
@ready="handleReady"
/>

@ready

ready(instance) fires once after initialization and the first sync:

<VueScheduler :events="events" @ready="onReady" />

instance Via Component Ref

import { ref } from "vue";
import type { VueSchedulerRef } from "@dhtmlx/trial-vue-scheduler";

const schedulerRef = ref<VueSchedulerRef | null>(null);

function showAlert() {
schedulerRef.value?.instance?.alert({
title:"Alert",
type:"alert-error",
text:"You can't do this"
});
}

Use this for advanced operations that are not practical through props.

Data Transport: load, save, batchSave

data prop shape:

interface VueSchedulerDataConfig {
load?: string | ((scheduler: SchedulerStatic) => DataSet | Promise<DataSet>);
save?: string | RouterFunction;
batchSave?: (changes: BatchChanges) => void;
}

load

  • URL string -> scheduler.load(url)
  • Function -> returns a sync or async dataset

save

Per-change callback or router transport via dataProcessor.

batchSave

Grouped callback for high-volume updates:

const data = {
batchSave: changes => {
if (changes.events?.length) {
console.log("events changes", changes.events);
}
}
};

Use batchSave when one scheduler action can trigger many updates.

Customization Hooks

customLightbox

Replace the built-in event form UI with a Vue component.

modals

Override delete confirmations and call callback() to confirm deletion.

const modals = {
onBeforeEventDelete: ({ event, callback }) => {
if (window.confirm(`Delete event ${event.text}?`)) callback();
}
};

For practical examples, see Customization Patterns.

Filtering events

These props are often used together in advanced timeline views:

<script setup lang="ts">
...
const query = ref("");
const eventFilter = computed(() => {
const value = query.value.trim().toLowerCase();
return (event: any) => {
if (!value) {
return true;
}
return String(event.text || "").toLowerCase().includes(value);
};
});
</script>

<template>
<VueScheduler
...
:filter="eventFilter"
...
/>
</template>

Exported Helpers And Composables

The package exports both a default VueScheduler component export and named exports.

From @dhtmlx/trial-vue-scheduler or @dhx/vue-scheduler:

Type Exports

Import every type from the wrapper package itself (@dhx/vue-scheduler or @dhtmlx/trial-vue-scheduler). The wrapper bundles the underlying Scheduler engine and re-exports its types alongside the Vue-specific ones - there is no separate @dhx/scheduler package to install or import from.

Wrapper-owned types

ExportDescription
SerializedEventUser-facing event shape with Date | string dates. Use for store state, initial data, and save/batchSave payloads.
VueSchedulerRefType of the value exposed via component ref - { instance: SchedulerStatic | null }.
VueSchedulerDataConfigShape of the data prop (load, save, batchSave).
BatchChangesArgument passed to data.batchSave - grouped events changes.
DataCallbackChangeIndividual change entry inside a BatchChanges bucket - { entity, action, data, id }.
MarkerShape of items in the markers prop.
SchedulerModalsShape of the modals prop - onBeforeEventDelete and onRecurrenceConfirm callback signatures.
CustomLightboxPropsProps received by your customLightbox component (data, onSave, onCancel, onDelete, schedulerInstance).
VueSchedulerEventHandlersType of the events prop - known events plus string-keyed custom events.

Frequently used types from the Scheduler engine

The wrapper re-exports every type from the underlying Scheduler engine. The ones below come up most often in wrapper code - each row maps a core type to where it shows up in the Vue API.

ExportWhere it appears in wrapper code
EventRuntime event shapes (include $-prefixed properties). Used inside event handlers, template callbacks, and filter functions.
SchedulerStaticType of schedulerRef.value?.instance and the @ready argument.
SchedulerConfigOptionsShape of the object passed to the config prop.
SchedulerPluginsShape of the object passed to the plugins prop.

Every other type from the Scheduler engine is also exported from the wrapper - if you can import a name from @dhx/scheduler in the standalone library, you can import it from @dhx/vue-scheduler here.

Use SerializedEvent for data you own (Pinia state, ref<>, API responses, initial literals). Use Event for data scheduler owns (inside event handlers, template callbacks, filter functions), where runtime event objects include internal $-prefixed properties.

Composables

The wrapper exposes five composables that wrap common instance-side calls in a ref-aware, lifecycle-safe form. Each one takes a Ref<VueSchedulerRef | null> so it can wait for the instance to become available.

useSchedulerEvent(schedulerRef, eventName, handler)

Attaches a single Scheduler event with a lifecycle-safe lifetime. The handler is detached automatically on component unmount and re-attached if schedulerRef, eventName, or handler change. Returns { detach } for manual control.

import { useSchedulerEvent } from "@dhtmlx/trial-vue-scheduler";

const { detach } = useSchedulerEvent(schedulerRef, "onDblClick", id => {
console.log("dbl-click", id);
});

// Optional: detach early
// detach();

Use this when one-off listeners do not fit cleanly into the events map (for example listeners that need to update or unsubscribe based on local state).

useSchedulerActions(schedulerRef)

Returns wrapper-safe imperative actions:

MethodSignatureNotes
render()() => voidForces a redraw for bulk mutations.
exportToPDF(config?: ExportConfig)() => voidRequires plugins: { export_api: true }. Pass exporter options through config.
exportToPNG(config?: ExportConfig)() => voidRequires plugins: { export_api: true }. Pass exporter options through config.
exportToExcel(config?)(config?: object) => voidRequires plugins: { export_api: true }. Pass exporter options through config.
exportToICal(config?: ExportConfig)() => voidRequires plugins: { export_api: true }. Pass exporter options through config.
import { ref } from "vue";
import { useSchedulerActions, type VueSchedulerRef } from "@dhtmlx/trial-vue-scheduler";

const schedulerRef = ref<VueSchedulerRef | null>(null);
const actions = useSchedulerActions(schedulerRef);

const exportPdf = () => actions.exportToPDF();
const exportExcel = () => actions.exportToExcel();
Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.