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

Deselecting a date in month view of Kendo Calendar

3 Answers 196 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Ravi
Top achievements
Rank 1
Ravi asked on 29 Nov 2012, 01:12 PM
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.)

3 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 30 Nov 2012, 05:09 PM
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!
0
Clinton Smyth
Top achievements
Rank 1
answered on 15 Jan 2013, 06:12 PM
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.
0
Georgi Krustev
Telerik team
answered on 17 Jan 2013, 10:08 AM
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!
Lance
Top achievements
Rank 1
commented on 02 Apr 2023, 02:21 AM

Has this been fixed yet?  If so, how do you prevent the scroll after deselecting?
Martin
Telerik team
commented on 04 Apr 2023, 02:15 PM

Could you please let me know how can I observe the scrolling in this Dojo example?
Tags
Calendar
Asked by
Ravi
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Clinton Smyth
Top achievements
Rank 1
Share this question
or