jQuery DatePicker完成按钮 [英] jquery DatePicker Done button
问题描述
是否可以处理在jquery UI DatePicker中按下完成"按钮的事件?
Is there any way to handle the event of pressing the "done" button in jquery UI DatePicker?
I have a datepicker that allows only to choose between year and month as in here
问题是使用onclose事件阻止我清除该字段(如果我单击弹出的日期选择器,那么如果我关闭当前选定的月份和年份,则将其放入该字段).
The problem is that using the onclose event prevents me from clearing the field (if I click the datepicker pops up then if I close the current selected month and year are put into the field).
我不想在日期选择器之外使用其他清除"按钮,因此尽管可以使用完成"按钮.
I would like not to use an additional "clear" button outside the datepicker, so I though I could use the Done button.
推荐答案
由于完成"按钮调用_hideDatepicker函数,因此您可以覆盖它:
As "Done" button calls _hideDatepicker function, you can override it:
jQuery.datepicker._hideDatepicker = function() {
alert('hello');
};
这篇关于jQuery DatePicker完成按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!