简体   繁体   English

如何捕获datePicker关闭事件

[英]How to catch the datePicker close event

I am using the date picker and it is working fine. 我正在使用日期选择器,它工作正常。 Few of my web page need some calculation using the start and end date. 我的网页很少需要使用开始和结束日期进行一些计算。 I would like to be able to do the calculation when the datepicker close. 我希望能够在datepicker关闭时进行计算。

I am using: 我在用:

< input class="datePicker" id="endDate" name="endDate" type="text" value="04/10/2013 23:00" /> <input class =“datePicker”id =“endDate”name =“endDate”type =“text”value =“04/10/2013 23:00”/>

Anybody have any suggestions? 有人有什么建议吗?

You are looking for onClose method. 您正在寻找onClose方法。

Refer to API Documentation here 请参阅此处的 API文档

Simple. 简单。 Just add your function into onClose event. 只需将您的函数添加到onClose事件中即可。 Sample code is below. 示例代码如下。

.datepicker({
    defaultDate: "+1w",
    changeMonth: true,
    changeYear: true,
    numberOfMonths: 1,
    onClose: function () {
        alert('Datepicker Closed');
    }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM