Clipboard in JavaScript Scheduler
The Clipboard functionality in the Scheduler enhances scheduling efficiency by enabling users to cut, copy, and paste appointments seamlessly. This feature is particularly beneficial for managing multiple appointments, eliminating repetitive data entry and allowing users to quickly adjust their schedules.
To activate clipboard functionality in the Scheduler, set the allowClipboard property to true.
Note: The
allowKeyboardInteractionproperty is set totruefor proper clipboard functionality via keyboard shortcuts.
Cut, copy, and paste using keyboard
The Scheduler supports keyboard shortcuts to streamline appointment management operations.
Use these keyboard shortcuts to manage appointments efficiently:
| Operation | Shortcut | Description |
|---|---|---|
| Copy | Ctrl+C | Duplicate the selected appointment for reuse in another time slot. |
| Cut | Ctrl+X | Remove the selected appointment from its current slot for relocation. |
| Paste | Ctrl+V | Insert the copied or cut appointment into the target time slot. |
To perform these operations, select an appointment and press Ctrl+C to copy or Ctrl+X to cut. Then, select the desired destination time slot and press Ctrl+V to paste the appointment.
Note: For Mac users, use
Cmdinstead ofCtrlfor copy, cut, and paste operations.
Cut, copy, and paste using context menu
You can programmatically manage appointments using the public methods cut, copy, and paste. These methods perform the same actions as the context menu or external buttons.
Use these public methods to programmatically control appointment operations in the Scheduler:
| Method | Parameters | Description |
|---|---|---|
copy |
None | Duplicate the selected appointment for reuse. |
cut |
None | Remove the selected appointment from its current slot for moving. |
paste |
targetElement (Scheduler’s work-cell) | Insert the copied or cut appointment into the specified time slot. |
By using these methods, you can programmatically cut, copy, and paste appointments in the Scheduler, providing more control over appointment management.
Modifying content before pasting
You can modify the content of an appointment before pasting it by using beforePaste event accessing the appointment details and making necessary changes.
The following example demonstrates how to copy content from a Grid control and paste it into the Scheduler. Follow these steps:
- Select an Item: Click on an item in the Grid control.
- Copy the Details: Press Ctrl + C to copy the selected item details.
- Choose a Time Slot: Click on the desired time slot in the Scheduler.
- Paste the Details: Press Ctrl + V to paste the copied appointment details into the selected time slot.
The beforePaste event intercepts the appointment data before insertion, allowing you to map Grid fields to Scheduler fields and modify properties as needed.
Note: Ensure that the field mapping matches the Scheduler’s event fields.
Refer to our JavaScript Scheduler feature tour page for an overview of key capabilities. You can also explore the JavaScript Scheduler example to learn how to present and manipulate data.