PDA

View Full Version : [CLOSED]problem of setting enable with fieldContainer!



terrycursh
16 Apr 2011, 12:35 AM
var NodeSettingP_0 = new Ext.form.FormPanel({
style:'padding:5px;',
layout:'anchor',
defaults:{
labelWidth:60,
labelAlign:'right',
anchor:'100%'
},
items:[
{
xtype: 'radiogroup',
fieldLabel: 'groups',
cls: 'x-check-group-alt',
items:[
{boxLabel: 'selectUser, name: 'selectP', inputValue: 1,width:100,
listeners: {
'change':function(){
if(this.getValue()){
Ext.getCmp("selectUserP").enable();
}
else{
Ext.getCmp("selectUserP").disable();
}
}
}
},
{boxLabel: 'selectGroup', name: 'selectP', inputValue: 2, width:100,checked:true,
listeners: {
'change':function(){
if(this.getValue()){
Ext.getCmp("selectGroupP").enable();
}
else{
Ext.getCmp("selectGroupP").disable();
}
}
}
}
],
height:30
},
{

id:'selectUserP',
disabled:true,
xtype: 'fieldcontainer',
layout: 'hbox',
defaultType: 'textfield',
fieldDefaults: {
labelAlign: 'right',
labelWidth:60
},
items:[
{
flex: 1,
name:'userNames',
fieldLabel: 'User,
allowBlank: false
},
{
width: 60,
xtype:'button',
margins: '0 5 0 5',
text:'Browser'
}
]
},
{
id:'selectGroupP',
xtype: 'fieldcontainer',
layout: 'hbox',
defaultType: 'textfield',
fieldDefaults: {
labelAlign: 'right',
labelWidth:60
},
items:[
{
flex: 1,
name:'groupNames',
fieldLabel: 'group',
allowBlank: false
},
{
width: 60,
xtype:'button',
margins: '0 5 0 5',
text:'Browser'
}
]
}
]
});

I just found a bug maybe not.
I set fieldContainer with selectUserP and set disabled true.
and when change the radioselect enable doesn`t work.
why?