ExtJS Turn combobox to displayfield

145 Views Asked by At

I have a grid with RowEditing that has a combobox.
When certain conditions are met, I want to turn that combo to a displayfield (I want the combo to just display its value, no button and not editable).
For now, when the conditions are met, I just disable the combobox; but it looks kinda funky that way. That's why I want to change.

1

There are 1 best solutions below

4
Alexander On

Easy as cake, thanks to disabledCls configuration.

editor:{
    xtype:'combobox',
    disabledCls:'some-css-class'
}

Then you can "turn the combobox to displayfield" using disable(), and it won't grey out.

To hide the button, you have to add some basic CSS:

.some-css-class .x-form-trigger {
    display:none;
}

https://fiddle.sencha.com/#fiddle/1b8d