Ext简单的Combox动态级联

这是Items内的3个Combox
{
columnWidth:.5,  //该列占用的宽度,标识为50%
layout: 'form',
border:false,
items:[{
xtype:'combo',
id:'fj',
store: fjStore,
triggerAction: 'all',
fieldLabel:'国家,
displayField:'deptname',
readOnly : true,
editable: false,
valueField:'code',
mode: 'local',
emptyText:'请选择国家...',
anchor:'90%',
listeners :{
select : function(combo, record, index){
Ext.getCmp('jgs').clearValue(); //清空省
Ext.getCmp('xcz').clearValue(); //清空市
jgsStore.load({
params :{
code : combo.getValue()
}});
}
}
},{
xtype:'combo',
id:'jgs',
store: jgsStore,
triggerAction: 'all',
fieldLabel:'所属省',
displayField:'deptname',
readOnly : true,
valueField:'code',
editable: false,
mode: 'local',
emptyText:'请选择省...',
anchor:'90%',
listeners :{
select : function(combo, record, index){
Ext.getCmp('xcz').clearValue(); //清空市
xczStore.load({
params :{
code : combo.getValue()
}});
}
}
},{
xtype:'combo',
id:'xcz',
store: xczStore,
triggerAction: 'all',
fieldLabel:'所属市',
displayField:'deptname',
readOnly : true,
valueField:'code',
editable: false,
mode: 'local',
emptyText:'请选择市...',
anchor:'90%'
}

本人也是新手,所以如有纰漏或者好的建议可以留言,欢迎大家进 群108912562 讨论一下!

你可能感兴趣的:(ext)