最近项目中用到了easyui,发现了很多用着不舒服的地方,
本文章就说一个datebox的小bug吧,由于easyui被我们重新封装了,我也不知道是哪个版本的bug,如果遇到这个问题就直接试试吧
bug产生条件:
$('#install_time').datebox({
width: 198,
value:'2015-11-01'
}).datebox('calendar').calendar({
validator: function(date) {
return date > new Date();
}
});
$("#install_time").datebox("setValue", '2015-11-01');
初始化的时候设置一次值,并且设置此事件不能设置当前以前的时间,然后再setValue 比当前时间早的事件,就会js报错了,解决办法很简单,就直接吧$(“#install_time”).datebox(“setValue”, ‘2015-11-01’);这一句注释掉就ok了,多此一举的一行代码,哈哈。