解决easy ui 1.4datebox控件不能清空的问题

时间:2022-08-10 17:02:11

用easy ui遇到这个问题,在网上找到了解决方案,不过是1.3.6版本的。现提供1.4版本的修改的具体位置和代码。

我们用的是这个解决easy ui 1.4datebox控件不能清空的问题

修改位置:12739行,添加代码:

 , {
text: function (_987) {
return $(_987).datebox("options").cleanText;
},
handler: function (_988) {
$(_988).combo("setValue", "").combo("setText", "");
$(_988).combo("hidePanel");
}
}

修改下面的代码的数字,修改为:

 , {
text: function (_989) {
return $(_989).datebox("options").closeText;
},handler:function(_990){
$(this).closest("div.combo-panel").panel("close");
}}

最终的buttons里的代码是:

 buttons:[{text:function(_985){
return $(_985).datebox("options").currentText;
},handler:function(_986){
$(_986).datebox("calendar").calendar({year:new Date().getFullYear(),month:new Date().getMonth()+1,current:new Date()});
_975(_986);
}
}, {
text: function (_987) {
return $(_987).datebox("options").cleanText;
},
handler: function (_988) {
$(_988).combo("setValue", "").combo("setText", "");
$(_988).combo("hidePanel");
}
}, {
text: function (_989) {
return $(_989).datebox("options").closeText;
},handler:function(_990){
$(this).closest("div.combo-panel").panel("close");
}}]

在汉化包相应位置添加代码:

$.fn.datebox.defaults.cleanText = '清空';