Copy and Paste Records in JavaScript Gantt Chart Control
18 Nov 20181 minute to read
The copy and paste functionality in the JavaScript Gantt Chart control enables efficient task duplication, allowing you to replicate tasks or entire task hierarchies using the addRecord method and a custom context menu configured via contextMenuItems. For example, right-clicking a parent task to copy and paste it with its child tasks at a specified position streamlines project management workflows. Inject Edit and enable editSettings.allowAdding to support adding copied records. Define valid taskFields mappings (e.g., id, name, startDate) to ensure task data is correctly replicated, including hierarchical structures with child tasks. Use the contextMenuClick event to handle custom copy-paste actions, specifying the paste position (e.g., child, above, below) via addRecord parameters. This feature integrates with dependencies, critical path, and virtual scrolling, ensuring duplicated tasks align with the project structure for seamless schedule management.