当前位置: 移动技术网 > IT编程>网页制作>Html5 > Easy-UI中datebox的默认显示当前日期的最简单的两种方法

Easy-UI中datebox的默认显示当前日期的最简单的两种方法

2018年06月07日  | 移动技术网IT编程  | 我要评论

阿莓莓直播视频,罗通拜师,洛克王国雪娃娃

在中有一个Today按钮就是实现显示当前日期,所以我们在src/jquery.datebox.js文件中可以找到currentText:'Today'。
所以我们可以使用'currentText'和'Today'来默认显示当前日期。
1.使用属性data-options="value:'currentText'"data-options="value:'Today'"
2.使用javascript设置$('#datebox1').datebox('setValue','Today')$('#datebox1').datebox('setValue','currentText');

------------------------------------题外话------------------------------------
Easy-UI使用一般需要引入2个css文件和2个js文件即可,文件名如下:
<link rel="stylesheet" type="text/css" href="jquery-easyui-1.5.5/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="jquery-easyui-1.5.5/themes/icon.css">
<script type="text/javascript" src="jquery-easyui-1.5.5/jquery.min.js"></script>
<script type="text/javascript" src="jquery-easyui-1.5.5/jquery.easyui.min.js"></script>

最后,如果想要datebox显示的是中文,那么请在jquery.easyui.min.js引入locale/easyui-lang-zh_CN.js即可。

提醒:使用easy-UI框架,javascript出现"Uncaught TypeError: Cannot read property 'options' of undefined" /xxx/jquery-easyui-1.5.5/jquery.easyui.min.js (15933)报错时,有可能是你写的javascript代码没有放在window.onload=function(){}$(function(){})之中。

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网