ext combobox级联加载数据
var comValue = null;
this.UPLOAD_TYPE_Field = new Ext.form.ComboBox({
id : 'listTyp',
fieldLabel : '类型',
store: new Ext.data.ArrayStore({
width:320,
id: 0,
fields: [
'VALUE',
'NAME'
],
data: [['1', '实时'],['2', '批量']]
}),
listeners:{
select:function(combo,record,opts) {
// 获取combox ID值
comValue = combo.getValue();
var cusGrpStore = Ext.getCmp("cusGrpId").getStore() ;
cusGrpStore.clearFilter();
cusGrpStore.load({
params: {lstTyp:comValue} //url中传递到后台的参数
});
}
} ,
valueField : 'VALUE',
displayField : 'NAME',
emptyText : '请选择',
mode : 'local',
name : 'UPLOADPARAMS.lstTyp',
hiddenName : 'UPLOADPARAMS.lstTyp',
triggerAction : 'all', //用all表示把下拉框列表的值全部显示出来,用query,如果你做了一次选择,第二次再去用,按第一次输入的值,它只显示匹配出来的
allowBlank:false,
anchor : '100%'
});
var storeUnit = new Ext.data.JsonStore({
fields : [ "CUS_GRP_ID", "CUS_GRP_NAM" ],
url : basePath + '/forSelect.do?from=custNameSelect',
autoLoad : true,
root : "custNameList" //后台返回的list
});
me.CUST_NAME_Field = new Ext.form.ComboBox({
id:'cusGrpId',
fieldLabel : '客群名称',
store: storeUnit,
valueField : 'CUS_GRP_ID',
displayField : 'CUS_GRP_NAM',
name : 'UPLOADPARAMS.cusGrpId',
hiddenName : 'UPLOADPARAMS.cusGrpId',
typeAhead: true, //延时查询,与下面的参数配合
mode: "local", //’local’取本地数据,默认为”remote”,远程获取
forceSelection: true,
triggerAction: "all",
emptyText:"请选择",
OnFocus:true,
allowBlank:false,
anchor : '100%'
});