csssmartgwttreegrid

How to apply different styles to TreeNode for different States?


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.


Solution

  • 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.