当前位置:网站首页>EasyUI date control emptying value
EasyUI date control emptying value
2022-07-07 21:05:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm the king of the whole stack .
Recently used Easyui Date control for datebox, Clear the selected value in the project , So I studied .
1. Call method to clear
$('#yourId').combo('setText','');
2, change js file
In the source file downloaded from the official website .datebox The control interface only has ‘Today’.‘Close’ event . We can add the event of clearing the option value to js In the middle , such , Just quote datebox This control , There will be an empty option on the interface . The detailed change process is as follows :
First, download it from the official website jquery.easyui.min.js file .
stay js Found in the file Today Close Where the event is defined , And add Clean Event definition .
Source file description :
Source file 12733–12742 Replace the line file with :
Code :
}},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){
The interface effect is as follows :
3, chinese js change
Above we put the source js It's changed , Only the interface shows English , Suppose you use a Chinese bag , It still needs to be changed easyui-lang-zh_CN.js
stay js Found in the file ‘ today ’ ‘ close ’ Where the event is defined , And add ‘ Empty ’
Code :
$.fn.datebox.defaults.currentText = ' today ';
$.fn.datebox.defaults.closeText = ' close ';
$.fn.datebox.defaults.cleanText = ' Empty ';
Change event :
Code :
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
});
}
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/116440.html Link to the original text :https://javaforall.cn
边栏推荐
- Hdu4876zcc love cards (multi check questions)
- [uvalive 6663 count the regions] (DFS + discretization) [easy to understand]
- Is it safe to open a stock account at present? Can I open an account online directly.
- 软件缺陷静态分析 CodeSonar 5.2 新版发布
- Lingyun going to sea | saihe & Huawei cloud: jointly help the sustainable development of cross-border e-commerce industry
- CodeSonar通过创新型静态分析增强软件可靠性
- 最新版本的CodeSonar改进了功能安全性,支持MISRA,C ++解析和可视化
- Alibaba cloud award winning experience: how to mount NAS file system through ECS
- Helix QAC 2020.2新版静态测试工具,最大限度扩展了标准合规性的覆盖范围
- Optimization cases of complex factor calculation: deep imbalance, buying and selling pressure index, volatility calculation
猜你喜欢
目标:不排斥 yaml 语法。争取快速上手
Codesonar Webinar
Measure the height of the building
神兵利器——敏感文件发现工具
上海交大最新《标签高效深度分割》研究进展综述,全面阐述无监督、粗监督、不完全监督和噪声监督的深度分割方法
Klocwork 代码静态分析工具
Is embedded system really safe? [how does onespin comprehensively solve the IC integrity problem for the development team]
恶魔奶爸 B3 少量泛读,完成两万词汇量+
MySQL约束之默认约束default与零填充约束zerofill
Don't fall behind! Simple and easy-to-use low code development to quickly build an intelligent management information system
随机推荐
目前股票开户安全吗?可以直接网上开户吗。
uva 12230 – Crossing Rivers(概率)「建议收藏」
Cocos2d-x game archive [easy to understand]
Mysql子查询关键字的使用方式(exists)
Write a jump table
凌云出海记 | 赛盒&华为云:共助跨境电商行业可持续发展
Is it safe to open an account of BOC shares in kainiu in 2022?
Tensorflow2. How to run under x 1 Code of X
嵌入式系统真正安全了吗?[ OneSpin如何为开发团队全面解决IC完整性问题 ]
使用枚举实现英文转盲文
恶魔奶爸 C
Hdu4876zcc love cards (multi check questions)
Intelligent transportation is full of vitality. What will happen in the future? [easy to understand]
Unity3d 4.3.4f1执行项目
Referrer和Referrer-Policy简介
写了个 Markdown 命令行小工具,希望能提高园友们发文的效率!
easyui 日期控件清空值
ERROR: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
软件缺陷静态分析 CodeSonar 5.2 新版发布
ERROR: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your