我给表单的每个元素加上了id
就有一个textfield的能通过getCmp()得到其元素,别的都是未定义
我加
listeners : {
afterrender : function (){alert('after');Ext.ComponentMgr.all.each(function(r){alert(r.id)});}
} 也是只有几个元素能拿到ID
items : [{
xtype:"panel",
border : false,
layout : 'hbox',
items : [{
xtype: 'radiogroup',
border : false,
columns: 4,
items : [{
//name : 'base',
boxLabel:"固定基线值来源于 "
},{
xtype:"combo",
id : 'aaaa',
triggerAction:"all",
displayField : 'week',
valueField : 'value',
name : 'config.baseWeek',
allowBlank : false,
blankText : '请输入选择基线日期',
style: {
marginBottom: '5px'
},
store:new Ext.data.SimpleStore({
fields:["week","value"],
data:[["第一周","第一周"] , ["第二周","第二周"],["第三周","第二周"],["第四周","第二周"]]}),
editable:false,
mode: 'local',
maxHeight: 200
}]
}] 这个拿不到ID
就有一个textfield的能通过getCmp()得到其元素,别的都是未定义
我加
listeners : {
afterrender : function (){alert('after');Ext.ComponentMgr.all.each(function(r){alert(r.id)});}
} 也是只有几个元素能拿到ID
items : [{
xtype:"panel",
border : false,
layout : 'hbox',
items : [{
xtype: 'radiogroup',
border : false,
columns: 4,
items : [{
//name : 'base',
boxLabel:"固定基线值来源于 "
},{
xtype:"combo",
id : 'aaaa',
triggerAction:"all",
displayField : 'week',
valueField : 'value',
name : 'config.baseWeek',
allowBlank : false,
blankText : '请输入选择基线日期',
style: {
marginBottom: '5px'
},
store:new Ext.data.SimpleStore({
fields:["week","value"],
data:[["第一周","第一周"] , ["第二周","第二周"],["第三周","第二周"],["第四周","第二周"]]}),
editable:false,
mode: 'local',
maxHeight: 200
}]
}] 这个拿不到ID
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货