问题
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 Hover). How can I achieve this?
Thanks in advance.
回答1:
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.
来源:https://stackoverflow.com/questions/8441631/how-to-apply-different-styles-to-treenode-for-different-states