当前位置:网站首页>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
边栏推荐
- Is it safe to open an account of BOC shares in kainiu in 2022?
- How does codesonar help UAVs find software defects?
- Cocos2d-x 游戏存档[通俗易懂]
- AADL Inspector 故障树安全分析模块
- Differences and connections between MinGW, mingw-w64, tdm-gcc and other tool chains "suggestions collection"
- Measure the height of the building
- ERROR: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
- 【奖励公示】第22期 2022年6月奖励名单公示:社区明星评选 | 新人奖 | 博客同步 | 推荐奖
- 目标:不排斥 yaml 语法。争取快速上手
- 智能交通焕发勃勃生机,未来会呈现哪些巨变?[通俗易懂]
猜你喜欢
Small guide for rapid formation of manipulator (12): inverse kinematics analysis
嵌入式系统真正安全了吗?[ OneSpin如何为开发团队全面解决IC完整性问题 ]
Optimization cases of complex factor calculation: deep imbalance, buying and selling pressure index, volatility calculation
Klocwork code static analysis tool
How does codesonar help UAVs find software defects?
Implement secondary index with Gaussian redis
Don't fall behind! Simple and easy-to-use low code development to quickly build an intelligent management information system
MySQL storage expression error
软件缺陷静态分析 CodeSonar 5.2 新版发布
如何满足医疗设备对安全性和保密性的双重需求?
随机推荐
Optimization cases of complex factor calculation: deep imbalance, buying and selling pressure index, volatility calculation
上海交大最新《标签高效深度分割》研究进展综述,全面阐述无监督、粗监督、不完全监督和噪声监督的深度分割方法
The latest version of codesonar has improved functional security and supports Misra, c++ parsing and visualization
Codeforces 474 F. Ant colony
CodeSonar如何帮助无人机查找软件缺陷?
How to choose fund products? What fund is suitable to buy in July 2022?
智能软件分析平台Embold
Intelligent transportation is full of vitality. What will happen in the future? [easy to understand]
Data sorting in string
如何挑选基金产品?2022年7月份适合买什么基金?
[uvalive 6663 count the regions] (DFS + discretization) [easy to understand]
复杂因子计算优化案例:深度不平衡、买卖压力指标、波动率计算
POJ 3140 contents division "suggestions collection"
写一下跳表
恶魔奶爸 A3阶段 近常速语流初接触
OneSpin 360 DV新版发布,刷新FPGA形式化验证功能体验
寫一下跳錶
CodeSonar通过创新型静态分析增强软件可靠性
如何满足医疗设备对安全性和保密性的双重需求?
[function recursion] do you know all five classic examples of simple recursion?