How to disable inputEl of a textbox in ExtJS?
I am working with ExtJS and I have a textbox component. I would like to disable only inputEl
the textbox component (not the label).
If I use the setDisabled()
textbox method it disables inputEl
but also the label.
I also used the method setReadOnly()
, but it is not grayed out inputEl
, only set as ReadOnly
.
Is there a way to disable just inputEl
the textbox component?
Thank you for your help.
source to share
I have another answer to Sencha forum (I thought it might be interesting to also post here) Solution
Use the setOpacity method
Ext.onReady(function () {
var panel =Ext.create('Ext.form.Panel', {
title: 'Basic Form',
renderTo: Ext.getBody(),
bodyPadding: 5,
width: 350,
items: [{
xtype: 'textfield',
fieldLabel: 'Field',
name: 'theField',
disabled: true
}]
});
panel.down('[xtype=textfield]').labelEl.setOpacity(1); });
source to share