EventCopyPaste
Feature
Allow using Ctrl/Cmd+C, Ctrl/Cmd+X and Ctrl/Cmd+V to copy/cut-and-paste events.
This feature also adds entries to the EventMenu for copying & cutting (see example below for how to configure) and to the ScheduleMenu for pasting.
You can configure how a newly pasted record is named using generateNewName.
This feature is enabled by default.
Customize menu items
See EventMenu and ScheduleMenu for more info on customizing the menu items supplied by the feature. This snippet illustrates the concept:
// Custom copy text + remove cut option from event menu:
const calendar = new Calendar({
features : {
eventMenu : {
items : {
copyEvent : {
text : 'Copy booking'
},
cutEvent : false
}
}
}
});
Keyboard shortcuts
The feature has the following default keyboard shortcuts:
| Keys | Action | Action description |
|---|---|---|
| Ctrl+C | copy | Copies selected event into the clipboard. |
| Ctrl+X | cut | Cuts out selected event into the clipboard. |
| Ctrl+V | paste | Insert copied or cut event from the clipboard. |
For more information on how to customize keyboard shortcuts, please see our guide.
Native/shared clipboard
If you have multiple Calendars (or other Bryntum products) on the same page, they will share clipboard. This makes it possible to copy and paste between different Calendar instances. It is also possible to use the native Clipboard API if it is available and if you set useNativeClipboard to true.
Regardless of native clipboard availability, copy-pasting "outside" of the current Calendar instance will convert the copied events to a string. When pasting, the string will then be parsed back into events. In case of usage of the native Clipboard API, this means it is possible to copy and paste events between completely different applications.
To configure the fields that is converted and parsed from the copied string value, please see the eventToStringFields config.
Useful configs
| Config | Description |
|---|---|
| generateNewName | Function to generate names for pasted events |
| useNativeClipboard | Enable native Clipboard API for cross-app paste |
| eventToStringFields | Fields included when serializing copied events |
| keyMap | Keyboard shortcut mappings |
See also
- EventMenu — Menu where copy/cut items appear
- ScheduleMenu — Menu where paste items appear
- EventModel — The event model being copied or pasted
Properties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of EventCopyPaste class, or subclass thereof.
-
Identifies an object as an instance of EventCopyPaste class, or subclass thereof.