PDA

View Full Version : Disable a combobox item?



deving
19 Apr 2013, 12:36 PM
Is there a built-in way for a combobox item to be disabled so that it still shows but clicking on it does nothing?

Thanks in advance...

slemmon
20 Apr 2013, 11:19 PM
There is not a built-in way to disable an item in the combobox directly. You can evaluate the record with a listener on the beforeselect event and return false to prevent it from being selected.
http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.form.field.ComboBox-event-beforeselect

girish.arjunagi
21 Apr 2013, 10:55 PM
Another way is to make the combo disabled true and set the disabledCls with opacity 1. Try with the below code.


set disabled : true,
disabledCls : 'opacity-full',

cls class -
.opacity-full{
opacity = 1;
}