I have a formPanel set up with a text field. When a button is pressed, I would like it to change the disabled property of the text field from true to false, allowing it to be editable. The problem is that I don’t know how to make this stick. Here’s the form code:
myApp.views.formContainer = new Ext.form.FormPanel({
id: 'inspectionForm',
layout: 'vbox',
width: '100%',
items: [{
xtype: 'textfield',
name: 'myText',
id: 'myText',
label: 'License Plate',
width: '90%'
},
{
xtype: 'button',
text: 'Submit',
height: 40,
ui: 'confirm-round',
handler: function()
{
Ext.get('myText').disabled = false;
}
}]
});
The thing about Ext.get('mytext'),disabled = false; is that it works. Checking it later shows that the disabled attribute is set to false. But you still can’t edit it. Does anyone know how to do this?
By calling
Ext.getCmp('mytext').disabled = false;you only change the initial config property. To actually modify the component useExt.getCmp('mytext').enable();andExt.getCmp('mytext').disable();