Kendo calendar selected date event

百般思念 提交于 2019-12-20 03:32:13

问题


Hi I've a kendo calendar and a text box in my page. When I select any date on the calendar, I wanted to show that value in my textbox. (like datetime picker). Any way to get it?

Here is my sample code

<div id="calendar"></div>
<input type="text" name="txtdate" id="txtdate"/>

 <script>
                $(document).ready(function() {
                    // create Calendar from div HTML element
                    $("#calendar").kendoCalendar();
                });

                var cal = $("#calendar").data("kendoCalendar");

                cal.bind("change", function () {
                    // Here I wanted to bind the selected value to my text box (txtdate).                      
                });
  </script>

回答1:


   var textVal =  $(this).value();
   $('#txtdate').val(textVal);


来源:https://stackoverflow.com/questions/17519284/kendo-calendar-selected-date-event

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!