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

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

我们用的是这个

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

1 , {
2     text: function (_987) {
3         return $(_987).datebox("options").cleanText;
4     },
5     handler: function (_988) {
6         $(_988).combo("setValue", "").combo("setText", ""); 
7         $(_988).combo("hidePanel"); 
8     }
9 }

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

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

最终的buttons里的代码是:

 1 buttons:[{text:function(_985){
 2 return $(_985).datebox("options").currentText;
 3 },handler:function(_986){
 4 $(_986).datebox("calendar").calendar({year:new Date().getFullYear(),month:new Date().getMonth()+1,current:new Date()});
 5 _975(_986);
 6 }
 7 }, {
 8     text: function (_987) {
 9         return $(_987).datebox("options").cleanText;
10     },
11     handler: function (_988) {
12         $(_988).combo("setValue", "").combo("setText", ""); 
13         $(_988).combo("hidePanel"); 
14     }
15 }, {
16     text: function (_989) {
17 return $(_989).datebox("options").closeText;
18 },handler:function(_990){
19 $(this).closest("div.combo-panel").panel("close");
20 }}]

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

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

转载于:https://www.cnblogs.com/zzgblog/p/4111072.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值