Ext JS 搜索 --下拉列表

var ds_getYear = new Ext.data.Store({
		autoLoad : true,
		proxy : new Ext.data.HttpProxy({
			url : '/getFrYear/',
			method : 'POST'
		}),
		reader : new Ext.data.JsonReader({
			root : 'yearList',
			fields : [{
				name : 'yearMap'
			}]
		})
	});
	var ds_getMonth = new Ext.data.Store({
		autoLoad : true,
		proxy : new Ext.data.HttpProxy({
			url : '/getFrMonth/',
			method : 'POST'
		}),
		reader : new Ext.data.JsonReader({
			root : 'monthList',
			fields : [{
				name : 'monthMap'
			}, {
				name : 'monthSelect'
			}]
		})
	});
var fitDateSelect_Year = new Ext.form.ComboBox({
		id : 'yearSelect',
		title : '年份',
		width : 90,
		store : ds_getYear,
		displayField : 'yearMap',
		valueField : 'yearMap',
		typeAhead : true,
		loadingText : '载入中...',
		shadow : true,
		mode : 'local',
		hiddenName : 'year',
		emptyText : '请选择年份',
		selectOnFocus : true,
		forceSelection : true,
		editable : true,
		value : Ext.util.Format.date(new Date(), 'Y'),
		triggerAction : 'all'
	});
	var fitDateSelect_Month = new Ext.form.ComboBox({
		title : '月份',
		id : 'monthSelect',
		width : 90,
		store : ds_getMonth,
		displayField : 'monthMap',
		valueField : 'monthMap',
		typeAhead : true,
		loadingText : '载入中...',
		shadow : true,
		mode : 'local',
		hiddenName : 'month',
		emptyText : '请选择月份',
		selectOnFocus : true,
		forceSelection : true,
		editable : true,
		value : Ext.util.Format.date(new Date(), 'm'),
		triggerAction : 'all'
	});

var grid = new xg.EditorGridPanel({
		title : "报表",
		ds : ds,
		cm : cm,
		tbar : [fitDateSelect_Year, fitDateSelect_Month, {
			text : '查询',
			handler : function() {
				ds.load({
					params : {
						year : Ext.get('yearSelect').dom.value,
						month : Ext.get('monthSelect').dom.value
					}
				});
			}
		}],

		frame : true,
		width : 1100,
		height : 450,
		clicksToEdit : 1,
		collapsible : true,
		animCollapse : true,
		trackMouseOver : false,
		enableColumnMove : true,
		iconCls : 'icon-grid'
	});


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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值