SmartGwt - 如何更改文本颜色?
是否可以更改 Gwt Widgets 中文本的颜色。
例如,假设我有一个带有 TreeGridFields 的 TreeGrid。
我可以更改打印树中的项目时呈现的颜色吗?
谢谢。
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 that is rendered when printing the items in the Tree?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这不一定是正确的方法,但我只是用
itemHere
包裹项目,效果就很好。我发现在 SmartGWT 中使用 css 有点痛苦。您还可以在 TreeGrid 中覆盖
protected String getCellCSSText(ListGridRecord record, int rowNum, int colNum)
并根据记录的值返回字体的 css 字符串。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.没有专门检查树,但您可以对网格执行此操作,如示例所示。也请查看其他示例。找不到专门针对树的树,但可能性会类似。 -
http://www.smartclient.com/smartgwt/showcase/#grid_appearance_hilite_add
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