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

Double click date event on non-editable Scheduler

2 Answers 597 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 08 Jul 2015, 02:28 PM

Hi,

 

I have a Kendo Scheduler which has Editable=false applied as it's for viewing only.  However, if you double-click on a date, I'd like the site to navigate to a separate page specific to that date to display a summary of what's happening on that date.  Therefore, I have bound a double-click event to each cell for this event - however, I don't have access to the date selected to pass to my next page.

        $('div.k-event-template').parent().dblclick(function () {
            alert("Handler for .dblclick() called.");
        });

What's the best way of achieving this?

 Thanks, Mark

2 Answers, 1 is accepted

Sort by
0
Accepted
Vladimir Iliev
Telerik team
answered on 10 Jul 2015, 05:33 AM
Hi Mark,

Basically if you need to get the event underlying object than you can attach the "dblclick" handler to the elements with ".k-event" class instead. When the user clicks on such element you can get it's "uid" attribute and pass it to the "occurrenceByUid" method of the scheduler:

$("#scheduler").on("dblclick", '.k-event', function (e) {
    var scheduler = $("#scheduler").getKendoScheduler();
    var element = $(e.target).is(".k-event") ? $(e.target) : $(e.target).closest(".k-event");
 
    var event = scheduler.occurrenceByUid(element.data("uid"));
    alert(event.title);
});

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Mark
Top achievements
Rank 1
answered on 10 Jul 2015, 11:01 AM
Cool, thanks!
Tags
Scheduler
Asked by
Mark
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Mark
Top achievements
Rank 1
Share this question
or