Clipboard in TypeScript Scheduler control
18 Nov 20183 minutes to read
The Clipboard functionality in the Scheduler control 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 to true for proper clipboard functionality through keyboard shortcuts.
Cut, copy, and paste using keyboard
The Scheduler control supports keyboard shortcuts to streamline appointment management operations.
Use these keyboard shortcuts to efficiently manage appointments:
| 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 Cmd instead of Ctrl for copy, cut, and paste operations.
Cut, copy, and paste using context menu
You can programmatically manage appointments by using the public methods cut, copy, and paste. These methods allow you to perform the same actions as the context menu or external buttons.
Use these public methods to programmatically control appointment operations in the Scheduler control:
| 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 the appointment management process.
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 with the fields in the scheduler.
You can refer to our JavaScript Scheduler feature tour page for its groundbreaking feature representations. You can also explore our JavaScript Scheduler example to knows how to present and manipulate data.