剑道日历选择日期事件 [英] Kendo calendar selected date event
本文介绍了剑道日历选择日期事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好我的页面中有一个剑道日历和一个文本框。当我在日历上选择任何日期时,我想在我的文本框中显示该值。 (如日期时间选择器)。有什么办法吗?
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?
这是我的示例代码
<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>
推荐答案
var textVal = $(this).value();
$('#txtdate').val(textVal);
这篇关于剑道日历选择日期事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文