Skip to content
Advertisement

How to disable the inputEl of a textfield in ExtJS?

I am working with ExtJS and I have a textfield component. I would like to disable only the inputEl of a textfield component (not the label).

If I use the setDisabled() method of the textfield, then it sets disabled the inputEl but also the label.

I have used also the setReadOnly() method, but it does not grey out the inputEl, only set as ReadOnly.

Is there a way to disable only the inputEl of a textfield component?

Thanks for your help.

Advertisement

Answer

You will have to set a custom class to the disabledCls

.ux-item-disabled .x-form-field, .ux-item-disabled .x-form-display-field, .ux-item-disabled .x-form-trigger {
   filter: alpha(opacity=30);
   opacity: .3;
}

see JSFiddle

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement