PDA

View Full Version : CSS on TextButton not working properly



joham
26 May 2014, 1:10 AM
I'm working on a project which was made using GWT components but now I want to change to GXT components.
For some reason the CSS doesn't work properly on my GXT TextButtons.
Button:

TextButton test = new TextButton("Test");
test.setStyleName("testStyle");

Result
49128
As you can see, the css is applied but only around the button. Have I missed something?

Colin Alworth
2 Jun 2014, 10:19 AM
What changes are you applying? GXT buttons are more complex than a single <button> element in order to be completely consistent cross browser, and support other features like split menus, icons, etc.

Have you tried the GXT 3.1 theme builder to see if it can generate your icons from just config settings, rather than getting the CSS right for each browser?

If you really want to build your own button HTML/CSS, look into implementing a custom button Appearance implementation, so that you can *completely* control the html, css, and basic behavior of your buttons.

Check out these guides for more details on the theme builder and appearances:
http://docs.sencha.com/gxt/3.1/concepts/ThemeBuilder.html
http://docs.sencha.com/gxt/3.1/concepts/Appearance_3.html