如何应用不同的样式到不同的州的TreeNode? [英] How to apply different styles to TreeNode for different States?

查看:101
本文介绍了如何应用不同的样式到不同的州的TreeNode?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Java,SmartGWT 2.5& Mozilla FF 3.6.x.我使用Tree,TreeGrid& TreeNode在我的应用程序。我的问题是:我想对树节点的3个不同状态的树节点应用不同的样式。状态是:已启用,已选择,已覆盖(鼠标悬停)。

解决方案



覆盖getBaseStyle()或getCellCSSText()。这里有一个例子:



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



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



API适用于TreeGrid,因为ListGrid是它的超类。这些方法的记录参数是您的TreeNode。


I'm working on Java, SmartGWT 2.5 & Mozilla FF 3.6.x. I'm using Tree, TreeGrid & TreeNode in my application. My question is: I want to apply different styles to a TreeNode for 3 different States of the TreeNode. The States are: Enabled, Selected, Over(Mouse over). How can I achieve this?

Thanks in advance.

解决方案

Override getBaseStyle() or getCellCSSText(). There's an example of each here:

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

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

This same API applies to TreeGrid because ListGrid is it's superclass. The "Record" parameter to these methods are your TreeNode.

这篇关于如何应用不同的样式到不同的州的TreeNode?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆