ligerui DateEditor时间控件实现赋值格式化和显示风格格式化,当只需要年月的时候界面不显示日期
1条回答
- 薛展 2016-04-29 02:04关注
第一步:在定义日期控件时,在options{}里面加入format:"yyyy-MM" 这是定义空间赋值的格式化
第二步:在ligerui.all js文件里面找到ligerui月份加载和单击事件, g.body.monthselector.hover(function () { }, function ().....$("li", g.body.monthselector).click(function ().......... 重写ligerui月份加载和单击事件:
g.body.monthselector.hover(function () { }, function ()
{
var p = this.options;
if (p.format!="yyyy-MM") {
$(this).slideUp("fast");
}
});
$("li", g.body.monthselector).click(function ()
{
var index = $("li", g.body.monthselector).index(this);
g.currentDate.month = index + 1;if (p.format!="yyyy-MM") { g.body.monthselector.slideToggle(); } g.bulidContent(); g.showDate(); if (p.format=="yyyy-MM") { g.toggleDateEditor(true); } });
第三步:在时间控件的页面加入css代码:
.l-box-dateeditor-monthselector { display:block; }大功告成: ![图片说明](https://img-ask.csdn.net/upload/201604/29/1461895461_388421.png)
解决 无用评论 打赏 举报
悬赏问题
- ¥15 数学建模招标中位数问题
- ¥15 phython路径名过长报错 不知道什么问题
- ¥15 深度学习中模型转换该怎么实现
- ¥15 HLs设计手写数字识别程序编译通不过
- ¥15 Stata外部命令安装问题求帮助!
- ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
- ¥15 TYPCE母转母,插入认方向
- ¥15 如何用python向钉钉机器人发送可以放大的图片?
- ¥15 matlab(相关搜索:紧聚焦)
- ¥15 基于51单片机的厨房煤气泄露检测报警系统设计