Ext.form.field.File disable button
I have the following file field:
{
xtype: 'filefield',
name: 'photo',
fieldLabel: 'Photo',
labelWidth: 50,
allowBlank: false,
buttonText: 'Select Photo...'
}
I am trying to disable the file field button:
if (f instanceof Ext.form.field.File) { //f is a field in my form
f.button.setDisabled(true)
}
This works as I expect visually, but after enabling this button, the button handler is no longer called.
I can hear what you think. Why don't you call setDisabled()
on the field? .. because the form won't submit its value if the field is disabled. And I implemented my own way to disable elements using CSS.
My question is: How can I disable a button filefield
in ExtJS 4.1.2?
+3
source to share