Extjs三级联动效果(1)

var firstStore = new Ext.data.JsonStore({
autoLoad : false,
url : 'getUnderLevelOrgs.action',
root : 'root',
totalProperty : 'totalProperty',
fields : ['id', 'name'],
baseParams : {
start : 0,
limit : 8,
id : 0,
level : 1
}
});

var secondStore = new Ext.data.Store({
proxy : new Ext.data.HttpProxy({
url : "getUnderLevelOrgs.action"
}),
reader : new Ext.data.JsonReader({
root : 'root',
totalProperty : 'totalProperty',
id : 'id',
fields : ['id','name']
})

})


var thirdStore = new Ext.data.JsonStore({
url : 'getUnderLevelOrgs.action',
root : 'root',
totalProperty : 'totalProperty',
fields : ['id', 'name']
})


var orgForm = new Ext.form.FormPanel({
title : '维护他人机构',
frame : true,
closable : true,
hideMode : 'offsets',
//constrainHeader : true,
labelAlign : 'right',
items : [{
fieldLabel : '执法人员',
forceSelection : true,
anchor : '80%',
queryDealy : 3000,
selectOnFocus : true,
typeAhead : true,
loadingText : '数据加载中......',
minChars : 0,
pageSize : 10,
minListWidth : 270,
name : 'id',
xtype : 'combo',
hiddenName : 'userId',
valueField : 'userId',
displayField : 'applicationame',
allowBlank : false,
blankText : '请选择人员',
emptyText : '请选择人员',
triggerAction : 'all',
mode : 'local',
store : personStore
},{
fieldLabel : '一级单位',
forceSelection : true,
autoLoad : false,
anchor : '80%',
queryDealy : 3000,
selectOnFocus : true,
typeAhead : true,
loadingText : '数据加载中......',
minChars : 0,
pageSize : 10,
minListWidth : 270,
name : 'firOrg',
xtype : 'combo',
hiddenName : 'id',
valueField : 'id',
displayField : 'name',
allowBlank : false,
blankText : '请选择一级单位',
emptyText : '请选择一级单位',
triggerAction : 'all',
// width : 150,
mode : 'remote',
store : firstStore,
listeners : {
change :function(node){
/*secUrl = 'global/globalAction!getUnderLevelOrgs.action';
secProxy.setUrl(secUrl);*/
secondStore.load({
params : {
start : 0,
limit : 5,
level : 2,
id : node.getValue()
}
});

}
}
},{
fieldLabel : '二级单位',
autoLoad : false,
forceSelection : true,
anchor : '80%',
queryDealy : 3000,
selectOnFocus : true,
typeAhead : true,
loadingText : '数据加载中......',
minChars : 0,
pageSize : 10,
minListWidth : 270,
name : 'secOrg',
xtype : 'combo',
hiddenName : 'id',
valueField : 'id',
displayField : 'name',
blankText : '请选择二级单位',
emptyText : '请选择二级单位',
triggerAction : 'all',
mode : 'local',
editable : false,
store : secondStore,
listeners : {
change : function(node){
thirdStore.load({
params : {
start : 0,
limit : 5,
level : 3,
id : node.getValue()
}
});
}
}
},{
fieldLabel : '三级单位',
autoLoad : false,
forceSelection : true,
anchor : '80%',
queryDealy : 3000,
selectOnFocus : true,
typeAhead : true,
loadingText : '数据加载中......',
minChars : 0,
pageSize : 10,
minListWidth : 270,
name : 'id',
xtype : 'combo',
hiddenName : 'id',
valueField : 'id',
displayField : 'name',
blankText : '请选择三级单位',
emptyText : '请选择三级单位',
triggerAction : 'all',
// width : 150,
mode : 'local',
editable : false,
store : thirdStore
}],
buttons : [{
text : '更新',
handler : function(btn){

}
}]


});

su.orgManager.win = new Ext.Window({
title : '机构维护',
//resizable : false,
layout : 'fit',
width : 350,
closeAction : 'hide',
height : 220,
items : [orgForm]
});
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值