Deselecting a date in month view of Kendo Calendar

4 posts, 0 answers
  1. Ravi
    Ravi avatar
    1 posts
    Member since:
    Nov 2012

    Posted 29 Nov 2012 Link to this post

    I have a calendar control which is made to display the dates for the month but none of the dates are selected/highlighted. Whenever we click on a date, it gets selected and highlighted. Now if I want to deselect any date selected, what can I do that ? (Means I want none of the dates selected without refreshing the page.)
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 30 Nov 2012 Link to this post

    Hello Ravi,

    You can use the value method of the Calendar and set null as value:

    $("#calendar").data("kendoCalendar").value(null);

    All the best,
    Georgi Krustev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Clinton Smyth
    Clinton Smyth avatar
    65 posts
    Member since:
    Apr 2007

    Posted 15 Jan 2013 Link to this post

    Hi

    This does indeed deselect the date, however, it causes the calendar to scroll as if you hit one of the nav buttons and returned to the same month.

    How do we disable the scroll - we just want to toggle the selection.
  5. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 17 Jan 2013 Link to this post

    Hello Clinton,

     
    Currently, the calendar will navigate when the one clears its value. We will try to improve this behavior in some of the future releases of Kendo UI. For now, if you just want ot toggle selection, then you can just remove the "k-state-selected" class from the cell.

    All the best,
    Georgi Krustev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready