david
david

Reputation: 2142

UiBinder FlexTable style

I want to add different styles to different rows, Which is the best way?

I'm trying this (it doesnt works, no error but no changes):

public interface StatiscticsTableResources extends ClientBundle {

public static final StatiscticsTableResources INSTANCE = GWT.create(StatiscticsTableResources.class);

@Source("StatisticsTableCss.css")
StatisticsTableCss css();

}

public interface StatisticsTableCss extends CssResource {

String tableOddRow();

}

.tableOddRow { background-color: #aeaaa2; color: blue; }

ftStatistics.getRowFormatter().addStyleName(i, StatiscticsTableResources.INSTANCE.css().tableOddRow());

Upvotes: 1

Views: 2386

Answers (1)

dslh
dslh

Reputation: 1835

Wild guess, you've forgotten to inject the style sheet. Somewhere at the top of the class where you apply the style, add this line:

static { StatisticsTableResources.INSTANCE.css().ensureInjected(); }

Upvotes: 4

Related Questions