您的位置:首页 > Web前端 > JavaScript

构造extjs两级联动comBox

2011-12-12 16:23 134 查看
{
columnWidth: .25,
layout: "form",
items: [{
xtype: 'combo',
fieldLabel: "区域",
editable: false,
//是否允许输入

hiddenName: 'quyu',
store: areaStore,
mode: 'remote',//第一个combo为remote
triggerAction: 'all',
emptyText: '请选择',
width: 100,
displayField: 'param_value',
allowBlank: false,
blankText: "参数不允许为空",
listeners: {

select: function (combo) {

var quyu = form.getForm().findField("quyu").getValue();
form.getForm().findField("Name").clearValue(); //可以实现当队下拉值变更时,清空从动combo下拉选项中的值

ProjectStore.load({ params: { quyu: quyu} });//加载第二个combo的数据源

}

}
}]
},
{
columnWidth: .25,
layout: "form",
items: [{
xtype: 'combo',
fieldLabel: "选择项目",
editable: false,
//是否允许输入

hiddenName: 'Name',
store: ProjectStore,//数据源
mode: 'local',//第二个combo为local
triggerAction: 'all',
emptyText: '项目名称',
width: 100,
displayField: 'name',
allowBlank: false,
blankText: "参数不允许为空"
}]
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: