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 执行 virtuoso 命令后,界面没有,cadence 启动不起来
- ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
- ¥20 有关区间dp的问题求解
- ¥15 多电路系统共用电源的串扰问题
- ¥15 slam rangenet++配置
- ¥15 有没有研究水声通信方面的帮我改俩matlab代码
- ¥15 ubuntu子系统密码忘记
- ¥15 保护模式-系统加载-段寄存器
- ¥15 电脑桌面设定一个区域禁止鼠标操作