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'
});
Ext JS 搜索 --下拉列表
最新推荐文章于 2022-09-17 11:42:03 发布