ScheduleMenu
Feature
Displays a context menu for empty parts of the schedule. Items are populated in the first place by configurations of this Feature, then by other features and/or application code.
Default scheduler zone menu items
The Scheduler menu feature provides only one item:
| Reference | Text | Weight | Feature | Description |
|---|---|---|---|---|
addEvent |
Add event | 100 | This feature | Add new event at the target time and resource. Hidden when read-only |
pasteEvent |
Paste event | 110 | EventCopyPaste | Paste event at the target time and resource. Hidden when is read-only |
splitSchedule |
Split | 200 | Split | Shows the "Split schedule" sub-menu |
> splitHorizontally |
Horizontally | 100 | Split | Split horizontally |
> splitVertically |
Vertically | 200 | Split | Split vertically |
> splitBoth |
Both | 300 | Split | Split both ways |
unsplitSchedule |
Split | 210 | Split | Unsplit a previously split schedule |
- >
- first level of submenu
Customizing the menu items
The menu items in the Scheduler menu can be customized, existing items can be changed or removed, and new items can be added. This is handled using the items config of the feature.
Add extra item:
const scheduler = new Scheduler({
features : {
scheduleMenu : {
items : {
extraItem : {
text : 'Extra',
icon : 'fa fa-fw fa-flag',
onItem({date, resourceRecord, items}) {
// Custom date based action
}
}
}
}
}
});
Remove existing item:
const scheduler = new Scheduler({
features : {
scheduleMenu : {
items : {
addEvent : false
}
}
}
});
Customize existing item:
const scheduler = new Scheduler({
features : {
scheduleMenu : {
items : {
addEvent : {
text : 'Create new booking'
}
}
}
}
});
Manipulate existing items:
const scheduler = new Scheduler({
features : {
scheduleMenu : {
// Process items before menu is shown
processItems({date, resourceRecord, items}) {
// Add an extra item for ancient times
if (date < new Date(2018, 11, 17)) {
items.modernize = {
text : 'Modernize',
ontItem({ date }) {
// Custom date based action
}
};
}
// Do not show menu for Sundays
if (date.getDay() === 0) {
return false;
}
}
}
}
});
The `processItems` implementation my be an `async` function which `awaits` a result to mutate the `items` object.
Video guides
Full information of the menu customization can be found in the "Customizing the Event menu, the Schedule menu, and the TimeAxisHeader menu" guide.
This feature is enabled by default
Useful configs and functions
| Member | Description |
|---|---|
| items | Menu items configuration object |
| scheduleMenuBeforeShow | Fires before menu is shown |
| scheduleMenuItem | Fires when a menu item is clicked |
| scheduleMenuShow | Fires after menu is shown |
See also
- EventMenu - Event context menu
- ResourceMenu - Resource context menu (vertical mode)
- TimeSpanMenuBase - Base context menu class
No results
Configs
Configs are options you supply in a configuration object when creating an instance of this classProperties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of ScheduleMenu class, or subclass thereof.
-
Identifies an object as an instance of ScheduleMenu class, or subclass thereof.