【SENCHA TOUCH】picker的使用

这里的年我是从数据库读取绑定的。格式如月格式。


			picker = Ext.create('Ext.Picker', {
						doneButton : '确认',
						cancelButton : '取消',
						useTitles : false,
						slots : [{
									name : 'year',
									title : '年份',
									align : "center",
									data : records
									
								}, {
									name : 'month',
									title : '月份',
									align : "center",
									data : storeMonth
								}],
						listeners : {
							change : function(picker, value, eOpts) {
								var returnStr = tongpuHttpRequest("text",
										"./file!fileUrl.do?", "year="
												+ value.year + "&month="
												+ value.month + "&rand="
												+ Math.random());
								if (returnStr != null && returnStr.length > 0) {
									window.open(returnStr);
								} else {
									alert('暂无数据!');
								}
								// 写入日志
								Ext.Ajax.request({
											url : "./util/weblog!addWebMisLog.do?id="
													+ bbid,
											success : function(result) {
											},
											failure : function(result) {
											}
										});
							}
						}
					});
			Ext.Viewport.add(picker);
			picker.show();

var storeMonth = [{
			text : '1月',
			value : '1'
		}, {
			text : '2月',
			value : '2'
		}, {
			text : '3月',
			value : '3'
		}, {
			text : '4月',
			value : '4'
		}, {
			text : '5月',
			value : '5'
		}, {
			text : '6月',
			value : '6'
		}, {
			text : '7月',
			value : '7'
		}, {
			text : '8月',
			value : '8'
		}, {
			text : '9月',
			value : '9'
		}, {
			text : '10月',
			value : '10'
		}, {
			text : '11月',
			value : '11'
		}, {
			text : '12月',
			value : '12'
		}];

原帖地址:http://blog.csdn.net/hateson/article/details/9820149




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值