当前位置:网站首页>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
边栏推荐
猜你喜欢

Static analysis of software defects codesonar 5.2 release

H3C s7000/s7500e/10500 series post stack BFD detection configuration method

Cantata9.0 | 全 新 功 能

目标:不排斥 yaml 语法。争取快速上手

复杂因子计算优化案例:深度不平衡、买卖压力指标、波动率计算

The latest version of codesonar has improved functional security and supports Misra, c++ parsing and visualization

Onespin | solve the problems of hardware Trojan horse and security trust in IC Design

Implement secondary index with Gaussian redis

Measure the height of the building

ERROR: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
随机推荐
写一下跳表
解决使用uni-app MediaError MediaError ErrorCode -5
I have to use my ID card to open an account. Is the bank card safe? I don't understand it
嵌入式系统真正安全了吗?[ OneSpin如何为开发团队全面解决IC完整性问题 ]
华泰证券可以做到万一佣金吗,万一开户安全嘛
Intelligent software analysis platform embold
Lingyun going to sea | saihe & Huawei cloud: jointly help the sustainable development of cross-border e-commerce industry
OneSpin | 解决IC设计中的硬件木马和安全信任问题
AADL Inspector 故障树安全分析模块
Hdu4876zcc love cards (multi check questions)
权限不足
Implement secondary index with Gaussian redis
恶魔奶爸 C
easyui 日期控件清空值
现在网上开户安全么?想知道我现在在南宁,到哪里开户比较好?
Ubuntu安装mysql8遇到的问题以及详细安装过程
【C语言】指针进阶---指针你真的学懂了吗?
CodeSonar如何帮助无人机查找软件缺陷?
阿洛的烦恼
Nebula Importer 数据导入实践