当前位置:网站首页>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
边栏推荐
- Small guide for rapid formation of manipulator (11): standard nomenclature of coordinate system
- 寫一下跳錶
- Tensorflow2. How to run under x 1 Code of X
- FTP steps for downloading files from Huawei CE switches
- 恶魔奶爸 A1 语音听力初挑战
- easyui 日期控件清空值
- 使用高斯Redis实现二级索引
- You want to kill a port process, but you can't find it in the service list. You can find this process and kill it through the command line to reduce restarting the computer and find the root cause of
- [function recursion] do you know all five classic examples of simple recursion?
- I wrote a markdown command line gadget, hoping to improve the efficiency of sending documents by garden friends!
猜你喜欢
Klocwork 代码静态分析工具

Details of C language integer and floating-point data storage in memory (including details of original code, inverse code, complement, size end storage, etc.)

【OpenCV 例程200篇】223. 特征提取之多边形拟合(cv.approxPolyDP)
SQL注入报错注入函数图文详解

使用枚举实现英文转盲文

C语言 整型 和 浮点型 数据在内存中存储详解(内含原码反码补码,大小端存储等详解)

C语言多角度帮助你深入理解指针(1. 字符指针2. 数组指针和 指针数组 、数组传参和指针传参3. 函数指针4. 函数指针数组5. 指向函数指针数组的指针6. 回调函数)

Tensorflow2. How to run under x 1 Code of X
Lex & yacc of Pisa proxy SQL parsing

CodeSonar如何帮助无人机查找软件缺陷?
随机推荐
恶魔奶爸 A3阶段 近常速语流初接触
[function recursion] do you know all five classic examples of simple recursion?
gridView自己定义做时间排版「建议收藏」
Unity3d 4.3.4f1 execution project
Is private equity legal in China? Is it safe?
程序猿赚的那点钱算个P啊!
开户必须往账户里面赚钱吗,资金安全吗?
CodeSonar网络研讨会
Cantata9.0 | 全 新 功 能
Implement secondary index with Gaussian redis
FatMouse' Trade (Hangdian 1009)
Implement secondary index with Gaussian redis
GridView defines its own time for typesetting "suggestions collection"
Can Huatai Securities achieve Commission in case of any accident? Is it safe to open an account
FatMouse' Trade(杭电1009)
写了个 Markdown 命令行小工具,希望能提高园友们发文的效率!
How to meet the dual needs of security and confidentiality of medical devices?
Details of C language integer and floating-point data storage in memory (including details of original code, inverse code, complement, size end storage, etc.)
I wrote a markdown command line gadget, hoping to improve the efficiency of sending documents by garden friends!
Helix QAC 2020.2新版静态测试工具,最大限度扩展了标准合规性的覆盖范围