老板让我改个用Ext写的前台,以前很少接触Ext,求大神们进来帮忙啊

乱世丶桃花 2014-05-08 03:37:55
var tbRow = new Ext.Toolbar({
items : [{
//红色部分是我自己写的,下拉框中要求有两个选项:发生时间(value=0)和终止时间(value=1),求大神帮忙写下
text : '时间类型:'
}, {
id : 'time_type',
xtype : 'combo'
},
{
text : '起始时间:'
}, {
id : 'happentime_query_start',
xtype : 'datefield'
}, {
text : '截止时间:'
}, {
id : 'happentime_query_end',
xtype : 'datefield'
}, {
text : '营业号:'
}, {
id : 'samcode_query',
xtype : 'numberfield',
width : '10%'
}, {
text : "查询",
handler : function() {
var happentime_start = Ext.util.Format.date(Ext
.getCmp('happentime_query_start')
.getValue(), "Y-m-d");
var happentime_end = Ext.util.Format.date(Ext
.getCmp('happentime_query_end')
.getValue(), "Y-m-d");
if ((happentime_start == null || happentime_start == ""
|| happentime_end == null || happentime_end == "")) {
alert("请选择查询日期!");
} else if (happentime_start.split("-")[0] == happentime_end
.split("-")[0]
&& parseInt(happentime_start.split("-")[1]) == (parseInt(happentime_end
.split("-")[1]) - 1)
&& (parseInt(happentime_start.split("-")[2]) > parseInt(happentime_end
.split("-")[2]))) {
grid.getStore().loadPage(1);
} else if (happentime_start.split("-")[0] == happentime_end
.split("-")[0]
&& parseInt(happentime_start.split("-")[1]) == parseInt(happentime_end
.split("-")[1])
&& (parseInt(happentime_start.split("-")[2]) <= parseInt(happentime_end
.split("-")[2]))) {
grid.getStore().loadPage(1);
} else {
alert("查询日期间隔为1个月,请重新选择查询日期范围!!");
}
}
}]
});

生成的页面效果:
...全文
45 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

10,606

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 其他
社区管理员
  • 其他
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧