这里的年我是从数据库读取绑定的。格式如月格式。
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