This is a migrated thread and some comments may be shown as answers.

Copy and paste action in Scheduler

2 Answers 269 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 10 Oct 2017, 07:27 AM

Hi,

Currently the scheduler has Clone Events to demonstrates how to clone events in the Scheduler. But how we can copy and paste an event on scheduler.

Regards.

2 Answers, 1 is accepted

Sort by
0
Tyler
Top achievements
Rank 1
answered on 10 Oct 2017, 07:20 PM

What exactly is the purpose of this, or how were you thinking this would be done? 

One thing you could do, is listen for keydown and keyup in the window, then when you detect ctrl+c, you copy the selected event (which you grab in the change event of the scheduler, when a user clicks on an event, the change event fires and that event will be available in the change event) by cloning it into a new event. Then, have the user click some new time slot, and when you detect ctrl+v, add that 'copied' event to the dataSource, sync the dataSource, and refresh the scheduler (or triggering your create method would probably be better).

0
Ivan Danchev
Telerik team
answered on 11 Oct 2017, 02:54 PM
Hi Jason,

The approach Tyler described is a possible way for copying ("cloning") events in the Scheduler. I'll post several links to the API, which could be helpful. You can get the currently selected event with the Scheduler's select event. The DataSource's has add and sync methods. An event can be added through the Scheduler's API with the addEvent and saveEvent methods. The Scheduler can be refreshed with its view method: scheduler.view(scheduler.view().name)

Regards,
Ivan Danchev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Scheduler
Asked by
Jason
Top achievements
Rank 1
Answers by
Tyler
Top achievements
Rank 1
Ivan Danchev
Telerik team
Share this question
or