PDA

View Full Version : Styling ComboBox



Lukich
15 Nov 2011, 2:44 PM
Hi. I'm trying to apply some styles to the ComboBox field, trying to make it larger. The only way I was able to do that was by adding fieldCls element to it and styling that class. However, only some styles make it through. Others get overridden and the only way to make them work is to add !important tag to them, which I'm not a big fan of.
Am i doing it wrong? Please advise.
Thanks!
Luka

mitchellsimoens
16 Nov 2011, 7:01 AM
What framework and version so that I can move this thread to the appropriate forum?

Lukich
17 Nov 2011, 11:26 AM
This is ExtJS 4. As I played around with it I discovered that I had ext-all-gray.css after my custom styles. Moving my styles below helped some, but not completely. For example, if I assign a fieldCls to my combobox field and then specify its height, it gets overridden by .x-border-box .x-form-text in all-gray-css, while width is getting assigned to the element inline.

I understand about specificity and I understand why two combined classes outweigh a single baseCls I define. And to remedy that and get my height in, I can use a combination of an id assigned to my combobox + input class, which takes care of height. However, width is getting assigned inline, so my changes are still getting overridden. Basically, I can tweak things here and there, but it feels that I'm missing some definitive way to style an element and get all my styles in easily.

Any pointers would be welcome.
Thanks!
Luka