{
xtype:'container',
layout:{type:'hbox',defaultMargins:{top:0,right:0,bottom:15,left:0}},
items:[
{
xtype: 'combo',
name: 'calltype_first', //要改
width: 200,
valueField: 'id',
labelWidth:120,
fieldLabel:'修改后通话记录类型',
emptyText: '请选择',
displayField:'name',
valueField:'id',
margin:'0 10 0 0 ',
queryMode:'local',
editable:false,
autoSelect:true,
listConfig: { loadMask: false },
store: {
xtype: "store",
fields: ['id', 'name', 'parentid', 'code'],
proxy: {
type: 'ajax',
url: 'getElements.action',
method: 'POST',
extraParams: {
//的parentid
parentid: Ext.query("#callTypeDicElementParentId")[0].value ,
layer: 1
},
reader: {
root: 'data'
}
},
autoLoad: true
},
listeners: { //监听,当用户选择省的时候,从后台获取该省的市
select: function (combo, records, index) {
var form_temp = this.up("form"); //up方法的API解释为:通过简单的选择,获得相匹配的dom,使用up方法总是返回一个Ext.core.Element,也就是ext的组件。
if (this.value != null && this.value != "") {
form_temp.down("combo[name='calltype_second']").clearValue();
//down方法的API解释,通过选择器,来获得任何深度的子组件,在down方法中,不应该包含组件的id,而应该是组件的xtype。
form_temp.down("combo[name='calltype_third']").clearValue(); form_temp.down("combo[name='calltype_second']").store.removeAll(true);
form_temp.down("combo[name='calltype_third']").store.removeAll(true); form_temp.down("combo[name='calltype_second']").store.load({
params: {
layer: 2,
parentid: records[0].data.id
}
});
}
} }
},
{
xtype: 'combo',
name: 'calltype_second',
displayField: 'name',
valueField: 'id',
width: 140,
hideLabel:true,
margin:'0 5 0 0 ',
blankText: '请选择',
emptyText: '请选择',
fieldLabel: '',
queryMode: 'local',
autoSelect: true,
editable: false,
valueNotFoundText: '',
listConfig: {
loadMask: false
},
store: {
xtype: "store",
fields: ['id', 'name', 'layer', 'parentid', 'code'],
proxy: {
type: 'ajax',
url: 'getElements.action',
method: 'POST',
reader: {
root: 'data'
}
},
autoLoad: false
},
listeners: { //监听,当用户选择市的时候,从后台获取该市的区
select: function (combo, records, index) {
var form_temp = this.up("form");
if (this.value != null && this.value != "") {
form_temp.down("combo[name='calltype_third']").clearValue();
form_temp.down("combo[name='calltype_third']").store.removeAll(true);
form_temp.down("combo[name='calltype_third']").store.load({
params: {
layer: 3,
parentid: records[0].data.id
}
});
}
} }
}
,
{
xtype: 'combo',
name: 'calltype_third',
displayField: 'name',
valueField: 'id',
width: 150,
margin:'0 5 0 5 ',
hideLabel:true,
blankText: '请选择',
emptyText: '请选择',
fieldLabel: '',
queryMode: 'local',
autoSelect: true,
editable: false,
valueNotFoundText: '',
listConfig: {
loadMask: false
},
store: {
xtype: "store",
fields: ['id', 'name', 'layer', 'parentid', 'code'],
proxy: {
type: 'ajax',
url: 'getElements.action',
method: 'POST',
reader: {
root: 'data'
}
},
autoLoad: false
}} ]},{
xtype:'container',
layout:{type:'hbox',defaultMargins:{top:0,right:0,bottom:15,left:0}},
items:[
uuid_field,
{ xtype: 'textarea',rows: 3,width:550,name: 'contentDetail', cls: 'contentDetail', fieldLabel: '备注' }]}]
}extjs omboBoxcomboAjaxjson
xtype:'container',
layout:{type:'hbox',defaultMargins:{top:0,right:0,bottom:15,left:0}},
items:[
{
xtype: 'combo',
name: 'calltype_first', //要改
width: 200,
valueField: 'id',
labelWidth:120,
fieldLabel:'修改后通话记录类型',
emptyText: '请选择',
displayField:'name',
valueField:'id',
margin:'0 10 0 0 ',
queryMode:'local',
editable:false,
autoSelect:true,
listConfig: { loadMask: false },
store: {
xtype: "store",
fields: ['id', 'name', 'parentid', 'code'],
proxy: {
type: 'ajax',
url: 'getElements.action',
method: 'POST',
extraParams: {
//的parentid
parentid: Ext.query("#callTypeDicElementParentId")[0].value ,
layer: 1
},
reader: {
root: 'data'
}
},
autoLoad: true
},
listeners: { //监听,当用户选择省的时候,从后台获取该省的市
select: function (combo, records, index) {
var form_temp = this.up("form"); //up方法的API解释为:通过简单的选择,获得相匹配的dom,使用up方法总是返回一个Ext.core.Element,也就是ext的组件。
if (this.value != null && this.value != "") {
form_temp.down("combo[name='calltype_second']").clearValue();
//down方法的API解释,通过选择器,来获得任何深度的子组件,在down方法中,不应该包含组件的id,而应该是组件的xtype。
form_temp.down("combo[name='calltype_third']").clearValue(); form_temp.down("combo[name='calltype_second']").store.removeAll(true);
form_temp.down("combo[name='calltype_third']").store.removeAll(true); form_temp.down("combo[name='calltype_second']").store.load({
params: {
layer: 2,
parentid: records[0].data.id
}
});
}
} }
},
{
xtype: 'combo',
name: 'calltype_second',
displayField: 'name',
valueField: 'id',
width: 140,
hideLabel:true,
margin:'0 5 0 0 ',
blankText: '请选择',
emptyText: '请选择',
fieldLabel: '',
queryMode: 'local',
autoSelect: true,
editable: false,
valueNotFoundText: '',
listConfig: {
loadMask: false
},
store: {
xtype: "store",
fields: ['id', 'name', 'layer', 'parentid', 'code'],
proxy: {
type: 'ajax',
url: 'getElements.action',
method: 'POST',
reader: {
root: 'data'
}
},
autoLoad: false
},
listeners: { //监听,当用户选择市的时候,从后台获取该市的区
select: function (combo, records, index) {
var form_temp = this.up("form");
if (this.value != null && this.value != "") {
form_temp.down("combo[name='calltype_third']").clearValue();
form_temp.down("combo[name='calltype_third']").store.removeAll(true);
form_temp.down("combo[name='calltype_third']").store.load({
params: {
layer: 3,
parentid: records[0].data.id
}
});
}
} }
}
,
{
xtype: 'combo',
name: 'calltype_third',
displayField: 'name',
valueField: 'id',
width: 150,
margin:'0 5 0 5 ',
hideLabel:true,
blankText: '请选择',
emptyText: '请选择',
fieldLabel: '',
queryMode: 'local',
autoSelect: true,
editable: false,
valueNotFoundText: '',
listConfig: {
loadMask: false
},
store: {
xtype: "store",
fields: ['id', 'name', 'layer', 'parentid', 'code'],
proxy: {
type: 'ajax',
url: 'getElements.action',
method: 'POST',
reader: {
root: 'data'
}
},
autoLoad: false
}} ]},{
xtype:'container',
layout:{type:'hbox',defaultMargins:{top:0,right:0,bottom:15,left:0}},
items:[
uuid_field,
{ xtype: 'textarea',rows: 3,width:550,name: 'contentDetail', cls: 'contentDetail', fieldLabel: '备注' }]}]
}extjs omboBoxcomboAjaxjson
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货