ScheduleMenu
A feature which adds a context menu to the unoccupied parts of calendar views.
There is one predefined item provided by default:
addEventAdds an event at the time point indicated by the click
If the timepoint has only date-level granularity (Such as when clicking in a MonthView or
AgendaView, or YearView), the start time of the event will default to the configured
autoCreate's startHour property.
If the EventEdit feature is enabled, the new event is passed for editing.
Schedule menu
//<code-header>
fiddle.title = 'Schedule menu';
//</code-header>
const calendar = new Calendar({
appendTo : targetElement,
height : 500,
// We have a little less width in our context, so reduce the responsive breakpoints
responsive : {
small : {
when : 480
},
medium : {
when : 640
}
},
// Start life looking at this date
date : '2023-10-01',
sidebar : false,
events : [],
resources : [
{
id : 1,
name : 'Bob'
},
{
id : 2,
name : 'Kim'
}
],
// Features named by the properties are included.
// An object is used to configure the feature.
features : {
scheduleMenu : {
items : {
addMany : {
text : 'Add activities',
weight : 200,
icon : 'fa fa-fw fa-calendar-plus',
onItem({ item, date }) {
calendar.eventStore.add([
{ name : 'Task', startDate : date, duration : 1, durationUnit : 'h' },
{ name : 'Task #2', startDate : DateHelper.add(date, 1, 'h'), duration : 1, durationUnit : 'h' },
{ name : 'Task #3', startDate : DateHelper.add(date, 2, 'h'), duration : 1, durationUnit : 'h' }
]);
}
}
}
}
},
// Modes are the views available in the Calendar.
// An object is used to configure the view.
modes : {
agenda : null,
year : null,
week : {
dayStartTime : 8
},
day : {
dayStartTime : 8
}
}
});The items set can be reconfigured by providing an items property to this feature:
features : {
scheduleMenu : {
items : {
// Knocks out the predefined addEvent item
addEvent : null,
// Add our own custom item
disableDate : {
icon : 'fa fa-calendar-times',
text : 'Mark date unavailable',
// Will look up ownership chain and find the Calendar
handler : 'up.makeDateUnavailable'
}
}
}
},
makeDateUnavailable({ date }) {
// Pass to our own app logic
this.disableDate(date);
}
This feature is enabled by default.
Configs
18
Configs
18Other
triggerEvent: contextmenu | click | dblclick | null
An event which is used to show schedule menu. The available values for it are
contextmenu, click and dblclick. If no value is specified, default
value is used from contextMenuTriggerEvent
const calendar = new Calendar({
features : {
scheduleMenu : {
triggerEvent : 'click'
}
}
});
clickTriggerSelectorContextMenuBase
itemsScheduleMenu
keyMapContextMenuBase
menuContextMenuBase
namedItemsContextMenuBase
preventNativeMenuContextMenuBase
processItemsScheduleMenu
typeContextMenuBase
Misc
bubbleEventsEvents
callOnFunctionsEvents
clientInstancePlugin
localeClassLocalizable
localizableLocalizable
localizablePropertiesLocalizable
Properties
20
Properties
20Common
disabledInstancePlugin
Class hierarchy
Identifies an object as an instance of ScheduleMenu class, or subclass thereof.
Identifies an object as an instance of ScheduleMenu class, or subclass thereof.
isContextMenuBaseContextMenuBase
isEventsEvents
isInstancePluginInstancePlugin
isLocalizableLocalizable
isTimeSpanMenuBaseTimeSpanMenuBase
Functions
29
Functions
29Configuration
Events
detachListenersBase
Misc
animatePropertyBase
callbackBase
doDisableInstancePlugin
downloadTestCaseBase
resolveCallbackBase
updateLocalizationLocalizable
Other
addListenerEvents
hasListenerEvents
onEvents
relayAllEvents
removeAllListenersEvents
removeListenerEvents
resumeEventsEvents
showContextMenuContextMenuBase
suspendEventsEvents
triggerEvents
unEvents
Events
10
Events
10beforeDestroyEvents
catchAllEvents
contextMenuItemContextMenuBase
contextMenuToggleItemContextMenuBase
destroyEvents
disableInstancePlugin
enableInstancePlugin
scheduleMenuBeforeShowScheduleMenu
scheduleMenuItemScheduleMenu
scheduleMenuShowScheduleMenu
Event handlers
10
Event handlers
10onBeforeDestroyEvents
onCatchAllEvents
onContextMenuItemContextMenuBase
onContextMenuToggleItemContextMenuBase
onDestroyEvents
onDisableInstancePlugin
onEnableInstancePlugin
onScheduleMenuBeforeShowScheduleMenu
onScheduleMenuItemScheduleMenu
onScheduleMenuShowScheduleMenu