How to create function for select event?

2 posts, 0 answers
  1. Federico
    Federico avatar
    21 posts
    Member since:
    Oct 2017

    Posted 17 Nov Link to this post

    $("#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?

  2. Stefan
    Admin
    Stefan avatar
    1355 posts

    Posted 21 Nov Link to this post

    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.
Back to Top