EasyUI 中 class='easyui-datebox' 的日期控件是通过 EasyUI 插件添加的,它会覆盖原生的日期控件。因此,无法使用原生的方法绑定日期变更事件,需要使用 EasyUI 提供的方法。

以下两种方法可以用来绑定日期变更事件:

  1. 使用 EasyUI 提供的 on 方法:
$('.easyui-datebox').datebox().datebox('calendar').calendar({
    onSelect: function(date){
        console.log(date); //change事件的处理函数
    }
});
  1. 使用 EasyUI 提供的 event 属性:
$('.easyui-datebox').datebox({
    onSelect: function(date){
        console.log(date); //change事件的处理函数
    }
});
EasyUI Datebox 控件日期变更事件绑定方法

原文地址: https://www.cveoy.top/t/topic/obLr 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录