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.
Asked
Active
Viewed 126 times
-1

alexandre1985
- 1,056
- 3
- 13
- 31
1 Answers
0
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;
}

Alexander
- 19,906
- 19
- 75
- 162
-
Thank you for your answer. It appears a box either way and the box doesn't resize in order to fill the missing button so I believe it is better as a default disabled. I was thinking that the combo should look more like a displayfield (no box and no button) – alexandre1985 May 30 '16 at 20:57
-
Then you are using a different theme and would possibly have to change the CSS a bit. – Alexander May 30 '16 at 21:01
-
Changing the CSS can make the box disappear? I would like that. Only text, no box and no button – alexandre1985 Jun 01 '16 at 17:57
-
Delete the CSS file or remove it from index.html and check what's left. That's the part you can't change by changing the CSS. (if you don't want to test: If you remove the CSS, the page will either be completely blank or some black text fragments on white background...) – Alexander Jun 01 '16 at 19:31