开发者

SmartGwt - How to change text color?

开发者 https://www.devze.com 2023-02-17 07:18 出处:网络
is it possible to change the colour of text in Gwt Widgets.. For example, say I have a TreeGrid, with TreeGridFields.

is it possible to change the colour of text in Gwt Widgets..

For example, say I have a TreeGrid, with TreeGridFields.

Can I change the colour th开发者_如何学编程at is rendered when printing the items in the Tree?

Thanks.


It's not necessarily the correct way to do it but I just wrap the items with <font color='COLOR'>itemHere</font> and that works just fine. I've found working with css in SmartGWT to be a bit of a pain.

You can also override protected String getCellCSSText(ListGridRecord record, int rowNum, int colNum) within the TreeGrid and return a css string for the font depending on the value of the record.


Havent specifically checked for a Tree, but you can do it this way for Grids as shown in the example. Do look at other examples too. Couldnt find one for tree specifically, but chances are will be similar. -

http://www.smartclient.com/smartgwt/showcase/#grid_appearance_hilite_add

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号