在DateTimePicker控件中,如果validateOnBlur
为true,则onClose
函数在选择日期后或按Shift键后执行多次。我也想在datetimepicker控件之外单击时执行onClose
函数。如果您有任何解决方案,请分享。
ctrl.datetimepicker({
todayButton: true,
showClear: true,
toolbarPlacement: 'top',
format: displayformat,
closeOnWithoutClick: true,
validateOnBlur: true,
scrollMonth: false,
value: val != null ? new Date(val) : "",
onClose: function (dp, $input) {
alert("Hit")
},
yearStart: yearStart,
yearEnd: yearEnd,
timepicker: (displayformat.indexOf("H") > -1 || displayformat.indexOf("h") > -1) ? true : false,
datepicker: (displayformat.indexOf("D") > -1 || displayformat.indexOf("d") > -1) ? true : false,
allowTimes: this._allowedTime
});