当前位置:网站首页>easyui 日期控件清空值
easyui 日期控件清空值
2022-07-07 18:43:00 【全栈程序员站长】
大家好,又见面了,我是全栈君。
近期用了Easyui的日期控件datebox,项目中要将选中值清空,于是就研究了一下。
1。调用方法清空
$('#yourId').combo('setText','');2,更改js文件
从官网下载的源文件里。datebox控件界面仅仅有‘Today’。‘Close’事件。我们能够把清空选项值的事件加入到js中去,这样,仅仅要引用了datebox这个控件,界面上就会有清空选项。详细改动过程例如以下:
首先在官网上下载jquery.easyui.min.js文件。
在js文件里找到Today Close事件定义的地方,并加入Clean事件的定义。
源文件说明:
将源文件12733–12742行文件替换为:
代码:
}},currentText:"Today",cleanText:"Clean",closeText:"Close",okText:"Ok",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").closeText;
},handler:function(_988){
$(this).closest("div.combo-panel").panel("close");
}},{ text : function(_989) {
return $(_989).datebox("options").cleanText;
},handler : function(_990) {
$(_990).combo('setValue', '').combo('setText', '');
$(this).closest("div.combo-panel").panel("close");
}}],formatter:function(date){界面效果例如以下:
3,中文js更改
上面我们把源js改好了,仅仅只是界面显示的是英文,假设用了中文包的话,还须要更改easyui-lang-zh_CN.js
在js文件里找到‘今天’ ‘关闭 ’事件定义的地方,并加入‘清空’
代码:
$.fn.datebox.defaults.currentText = '今天';
$.fn.datebox.defaults.closeText = '关闭';
$.fn.datebox.defaults.cleanText = '清空';改动事件:
代码:
if ($.fn.datetimebox && $.fn.datebox){
$.extend($.fn.datetimebox.defaults,{
cleanText: $.fn.datebox.defaults.cleanText,
currentText: $.fn.datebox.defaults.currentText,
closeText: $.fn.datebox.defaults.closeText,
okText: $.fn.datebox.defaults.okText,
missingMessage: $.fn.datebox.defaults.missingMessage
});
}发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/116440.html原文链接:https://javaforall.cn
边栏推荐
- CodeSonar如何帮助无人机查找软件缺陷?
- 使用 BR 恢复 Azure Blob Storage 上的备份数据
- Cantata9.0 | 全 新 功 能
- Cantata9.0 | new features
- 使用camunda做工作流设计,驳回操作
- 恢复持久卷上的备份数据
- Update iteration summary of target detection based on deep learning (continuous update ing)
- How to choose fund products? What fund is suitable to buy in July 2022?
- CJSON内存泄漏的注意事项
- Data sorting in string
猜你喜欢

Splicing and splitting of integer ints
CodeSonar通过创新型静态分析增强软件可靠性

恶魔奶爸 B3 少量泛读,完成两万词汇量+

使用高斯Redis实现二级索引

测量楼的高度

如何满足医疗设备对安全性和保密性的双重需求?

One click deployment of any version of redis

How to meet the dual needs of security and confidentiality of medical devices?
![嵌入式系统真正安全了吗?[ OneSpin如何为开发团队全面解决IC完整性问题 ]](/img/af/61b384b1b6ba46aa1a6011f8a30085.png)
嵌入式系统真正安全了吗?[ OneSpin如何为开发团队全面解决IC完整性问题 ]

How to meet the dual needs of security and confidentiality of medical devices?
随机推荐
Cantata9.0 | new features
想杀死某个端口进程,但在服务列表中却找不到,可以之间通过命令行找到这个进程并杀死该进程,减少重启电脑和找到问题根源。
实战:sqlserver 2008 扩展事件-XML转换为标准的table格式[通俗易懂]
AADL inspector fault tree safety analysis module
字符串中数据排序
程序猿赚的那点钱算个P啊!
【解决】package ‘xxxx‘ is not in GOROOT
恶魔奶爸 B1 听力最后壁垒,一鼓作气突破
【奖励公示】第22期 2022年6月奖励名单公示:社区明星评选 | 新人奖 | 博客同步 | 推荐奖
Make this crmeb single merchant wechat mall system popular, so easy to use!
Phoenix JDBC
如何满足医疗设备对安全性和保密性的双重需求?
【论文阅读】MAPS: Multi-agent Reinforcement Learning-based Portfolio Management System
AIRIOT助力城市管廊工程,智慧物联守护城市生命线
Small guide for rapid formation of manipulator (12): inverse kinematics analysis
Écrivez une liste de sauts
静态测试工具
开发那些事儿:Go加C.free释放内存,编译报错是什么原因?
恶魔奶爸 C
H3C S7000/S7500E/10500系列堆叠后BFD检测配置方法