The Kendo UI calendar widget has two events—change
and navigate
. These events fire when the action after which they are named occurs. The Change
fires when the selected date is changed, navigate
fires when the calendar is navigated—such as when the month is changed or the view is moved up from "month" to "year".
What if you wanted the calendar to only appear when a user selected a certain input box on a page, and then place its value into that input element? You could try something like this. Modify the final script
block of the page that we are working on to look like this example:
<script type="text/javascript"> $(function () { $("#mvcCalendar").hide(); }); $(document).ready(function () { $("#mvcCalendar").data("kendoCalendar").bind("change", function (e) { var date = $("#mvcCalendar").data("kendoCalendar").value(); $("#showTheCalendar").val(kendo.toString(date, 'd')); }); }); $...