How to apply different styles to TreeNode for different States?

会有一股神秘感。 提交于 2020-01-16 19:21:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!