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

Call Scheduler events from EventTemplate

1 Answer 148 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 2
Peter asked on 06 Nov 2013, 04:24 PM
I'm using an EventTemplate to display in the agenda view.  I'd like to add a button in the template that will open the Edit window.  I've searched through the forums, but have not been able to find an example.  Can you provide an example showing how to do this?

Thanks,
-Pete

1 Answer, 1 is accepted

Sort by
0
Accepted
Rosen
Telerik team
answered on 07 Nov 2013, 12:51 PM
Hello Peter,

In order to achieve this you will need to use the Scheduler API's editEvent passing the event instance. For example:

$("#scheduler").on("click", ".k-task .k-edit", function(e) {
  e.preventDefault();
   
  var uid = $(this).closest(".k-task").data("uid"); // get the uid of the Event from the item's data attribute 
  var event = scheduler.occurrenceByUid(uid); // retrieve the event instance via the Scheduler
  scheduler.editEvent(event); 
});

Here you can find a sample of such approach.
Regards,
Rosen
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Scheduler
Asked by
Peter
Top achievements
Rank 2
Answers by
Rosen
Telerik team
Share this question
or