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

How to create function for select event?

1 Answer 317 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Federico
Top achievements
Rank 1
Federico asked on 17 Nov 2017, 11:15 AM
$("#mycalendar").kendoCalendar({
            value: today,
            dates: events,
            change: onChangeCalendar,
                month: {
                // template for dates in month view
                content: 
                     '# if ($.inArray(+data.date, data.dates) != -1) { #' +
                        '<div class="' +
                               "exhibition" +
                        '">#= data.value #</div>' +
                     '# } else { #' +
                     '#= data.value #' +
                     '# } #'
              },
              footer: false
    });

I have my Calendar with onChange function and i'd like to create onSelect function.

At my onChange i create a kendo window to show a message.

This should also happen at onSelect.

-Click element.
-Go to onchange

-Open the window

-Close window
-I click on the same item and it does not open (onSelect is not implemented)

Calendar don't have select event.

How can i do this?

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 21 Nov 2017, 06:53 AM
Hello, Federico,

Thank you for the details.

Currently, this can be achieved by custom logic on the change event.

This will require attaching a click handler on the currently selected item. Also, the event handler should be detached on the next change event in order to ensure that only one click event will be attached.

I made an example demonstrating this:

https://dojo.telerik.com/iDECU

I hope this is helpful.

Regards,
Stefan
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
Calendar
Asked by
Federico
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or