pjekel / cbtree

The Dijit Tree with Multi State Checkboxes, project code 'cbtree' , is a highly configurable dojo/dijit tree with support for multi-state checkboxes or third party widgets capable of presenting a so-called 'checked' state.
Other
75 stars 34 forks source link

Tree Node highlight #43

Closed bridgji closed 10 years ago

bridgji commented 10 years ago

Just wondering if you could point me in the correct direction. Is there a way to change the node background for a specific item programmatically? If I have 5 items in the tree I want to be able to make the background of one of the items change color like it does when the mouse is hovering over it. I know I want to highlight the 3rd item.

pjekel commented 10 years ago

First, you need to load the TreeStyling extension after which you can do things like:

tree.set("labelStyle", {backgroundColor: "yellow"}, storeItem);

See the following links for more details:

https://github.com/pjekel/cbtree/wiki/Tree-Styling https://github.com/pjekel/cbtree/wiki/Tree-Styling#styling-api-usage

Checkout example cbtree/demos/store/tree02.html

https://github.com/pjekel/cbtree/blob/master/demos/store/tree02.html