当前位置:网站首页>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
边栏推荐
- Unity3d 4.3.4f1执行项目
- Cocos2d-x game archive [easy to understand]
- 智能软件分析平台Embold
- How does codesonar help UAVs find software defects?
- 解决使用uni-app MediaError MediaError ErrorCode -5
- 私募基金在中國合法嗎?安全嗎?
- H3C s7000/s7500e/10500 series post stack BFD detection configuration method
- Feature generation
- HOJ 2245 浮游三角胞(数学啊 )
- [paper reading] maps: Multi-Agent Reinforcement Learning Based Portfolio Management System
猜你喜欢
【OpenCV 例程200篇】223. 特征提取之多边形拟合(cv.approxPolyDP)
Small guide for rapid formation of manipulator (11): standard nomenclature of coordinate system
Onespin | solve the problems of hardware Trojan horse and security trust in IC Design
Helix QAC 2020.2 new static test tool maximizes the coverage of standard compliance
The latest version of codesonar has improved functional security and supports Misra, c++ parsing and visualization
Implement secondary index with Gaussian redis
C语言 整型 和 浮点型 数据在内存中存储详解(内含原码反码补码,大小端存储等详解)
How to meet the dual needs of security and confidentiality of medical devices?
ERROR: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
Cantata9.0 | 全 新 功 能
随机推荐
Unity3d 4.3.4f1执行项目
MinGW MinGW-w64 TDM-GCC等工具链之间的差别与联系「建议收藏」
单词反转实现「建议收藏」
Ubuntu安装mysql8遇到的问题以及详细安装过程
FatMouse' Trade(杭电1009)
【函数递归】简单递归的5个经典例子,你都会吗?
ISO 26262 - 基于需求测试以外的考虑因素
Cocos2d-x 游戏存档[通俗易懂]
uva 12230 – Crossing Rivers(概率)「建议收藏」
最新版本的CodeSonar改进了功能安全性,支持MISRA,C ++解析和可视化
静态测试工具
恶魔奶爸 指南帖——简易版
How to meet the dual needs of security and confidentiality of medical devices?
Static analysis of software defects codesonar 5.2 release
Tensorflow2. How to run under x 1 Code of X
OneSpin 360 DV新版发布,刷新FPGA形式化验证功能体验
DataTable数据转换为实体
写了个 Markdown 命令行小工具,希望能提高园友们发文的效率!
Apifox interface integrated management new artifact
目前股票开户安全吗?可以直接网上开户吗。