Calendar( 日历)
2015-12-02 10:21
330 查看
本节课重点了解 EasyUI 中 Canlendar(日历)组件的使用方法,这个组件不依赖于其
他组件。
一. 加载方式
//class 加载方式
<div id="box" class="easyui-calendar"
style="width:200px;height:200px;"></div>
//JS 加载调用
$('#box').calendar({
});
二.属性列表
//属性设置
$('#box').calendar({
width : 200,
height : 200,
fit : false,
border : false,
firstDay : 0,
weeks : ['S','M','T','W','T','F','S'],
months : ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug',
'Sep', 'Oct', 'Nov', 'Dec'],
year : 2012,
month : 6,
current : new Date(2014,7,1),
formatter : function (date) {
return '#' + date.getDate();
},
styler : function (date) {
if (date.getDay() == 1) {
return 'background-color:#ccc';
}
},
validator : function (date) {
if (date.getDay() == 1) {
return true;
} else {
return false;
}
},
});
三.事件列表
//事件列表
$('#box').calendar({
onSelect : function (date) {
alert(date.getFullYear() + ":" + (date.getMonth() + 1) + ":"
+ date.getDate());
},
onChange : function (newDate, oldDate) {
alert(newDate + '|' + oldDate);
},
});
四.方法列表
//返回属性对象
console.log($('#box').calendar('options'));
//调整日历大小
$('#box').calendar('resize');
//移动到指定日期
$('#box').calendar('moveTo', new Date(2015,1,1));
PS:我们可以使用$.fn.calendar.defaults 重写默认值对象。
他组件。
一. 加载方式
//class 加载方式
<div id="box" class="easyui-calendar"
style="width:200px;height:200px;"></div>
//JS 加载调用
$('#box').calendar({
});
二.属性列表
//属性设置
$('#box').calendar({
width : 200,
height : 200,
fit : false,
border : false,
firstDay : 0,
weeks : ['S','M','T','W','T','F','S'],
months : ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug',
'Sep', 'Oct', 'Nov', 'Dec'],
year : 2012,
month : 6,
current : new Date(2014,7,1),
formatter : function (date) {
return '#' + date.getDate();
},
styler : function (date) {
if (date.getDay() == 1) {
return 'background-color:#ccc';
}
},
validator : function (date) {
if (date.getDay() == 1) {
return true;
} else {
return false;
}
},
});
三.事件列表
//事件列表
$('#box').calendar({
onSelect : function (date) {
alert(date.getFullYear() + ":" + (date.getMonth() + 1) + ":"
+ date.getDate());
},
onChange : function (newDate, oldDate) {
alert(newDate + '|' + oldDate);
},
});
四.方法列表
//返回属性对象
console.log($('#box').calendar('options'));
//调整日历大小
$('#box').calendar('resize');
//移动到指定日期
$('#box').calendar('moveTo', new Date(2015,1,1));
PS:我们可以使用$.fn.calendar.defaults 重写默认值对象。
相关文章推荐
- 活动的四种启动模式
- 解决iOS跳转页面时,把 tabbar 隐藏了,但是在跳转的时候 还会有 tabbar 的白色痕迹的办法
- Java 接口和抽象类区别
- Linux命令-cut、sort、uniq、wc、tee
- 简单的API服务器搭建
- memcached telnet command
- 9款经典华丽的CSS3分享按钮
- 【SSH项目实战】国税协同平台-32.我要投诉功能2
- IOS绘制文本
- leetcode Reverse Linked List---简单重点
- 神经网络为什么要有激活函数,为什么relu 能够防止梯度消失
- pt-table-checksum校验mysql数据一致性
- 对代理模式和装饰模式异同点的理解
- LeetCode-- Longest Palindromic Substring
- kafka 高吞吐量性能揭秘
- android杀掉指定包名的应用程序
- android 音频底层调试-tinyalsa
- 数据结构之创建二叉树
- Opencv——新版本2.4.2简介&FREAK和ORB特征描述子效果对比features2d
- android 从相册中获取图片设置成头像的问题: