EasyUI Datebox 控件日期变更事件绑定方法
EasyUI 中 class='easyui-datebox' 的日期控件是通过 EasyUI 插件添加的,它会覆盖原生的日期控件。因此,无法使用原生的方法绑定日期变更事件,需要使用 EasyUI 提供的方法。
以下两种方法可以用来绑定日期变更事件:
- 使用 EasyUI 提供的
on方法:
$('.easyui-datebox').datebox().datebox('calendar').calendar({
onSelect: function(date){
console.log(date); //change事件的处理函数
}
});
- 使用 EasyUI 提供的
event属性:
$('.easyui-datebox').datebox({
onSelect: function(date){
console.log(date); //change事件的处理函数
}
});
原文地址: https://www.cveoy.top/t/topic/obLr 著作权归作者所有。请勿转载和采集!