Disable Dynamically Dates in the Calendar
Environment
Product | Progress® Kendo UI® Calendar for jQuery |
Product Version | 2017.3.1026 |
Description
How can I disable dates in the Calendar after the widget was initialized?
Solution
- Destroy the Calendar by using the
destroy
method. - Initialize the Calendar with the disabled dates.
<div id="calendar"></div>
<a class="k-button" onclick="changeDisableDates()">Disable dates</a>
<script>
$("#calendar").kendoCalendar();
function changeDisableDates() {
var calendar = $('#calendar').data('kendoCalendar');
var options = calendar.options;
options.disableDates = ["mo", "sa"];
calendar.destroy();
$('#calendar').html('');
$('#calendar').kendoCalendar(options);
}
</script>