PDA

View Full Version : [CLOSED] class attribute doesn't work for SPAN when used with HTML as a ToolBarItem



plitvak
18 Jun 2008, 1:00 PM
The following code doesn't display bold text in the tool bar:



LayoutContainer mainContainer = new LayoutContainer();

ToolBar toolBar = new ToolBar();
toolBar.add( new AdapterToolItem( new HTML( "Test: <span class='bold-text'>bold text</span>" ) ) );

mainContainer.add( toolBar );
Whre:
.bold-text {
font-weight: bold;
}

While if you change it to the:


LayoutContainer mainContainer = new LayoutContainer();

ToolBar toolBar = new ToolBar();
toolBar.add( new AdapterToolItem( new HTML( "Test: <span style='font-weight: bold;'>bold text</span>" ) ) );

mainContainer.add( toolBar );
It works just fine.

darrellmeyer
18 Jun 2008, 1:15 PM
GXT does nothing to the HTML you use. I am pretty sure you have a problem with your CSS and it not being assigned to your span element. Use firebug and inspect the element and you will see what styles are applied to the span (or in this case, what styles are not applied).