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 求daily translation(DT)偏差订正方法的代码
- ¥15 js调用html页面需要隐藏某个按钮
- ¥15 ads仿真结果在圆图上是怎么读数的
- ¥20 Cotex M3的调试和程序执行方式是什么样的?
- ¥20 java项目连接sqlserver时报ssl相关错误
- ¥15 一道python难题3
- ¥15 牛顿斯科特系数表表示
- ¥15 arduino 步进电机
- ¥20 程序进入HardFault_Handler
- ¥15 关于#python#的问题:自动化测试