Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#5003 closed enhancement (fixed)

Tree: support separate (user-defined) icons for open / closed state

Reported by: bill Owned by:
Priority: high Milestone: 1.1
Component: Dijit Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

A user might want to have separate tree node icons for opened and closed states (think of Windows Explorer with the opened and closed folders). Want to have a CSS pattern/rule like:

.dijitTreeNodeContents .myIcon {
  background-image: url(...);
}
.dijitTreeNodeExpandedContents .myIcon {
  background-image: url(...);
}

The problem is that that expanded/contracted state can't be written on TreeNode.domNode because it will seep down to the children TreeNodes.

Alternately, make getIconClass() be called every time the node state changes (from expanded to collapsed), and pass in the new state.

Change History (7)

comment:1 Changed 12 years ago by bill

Description: modified (diff)
Summary: Tree: separate icons for open / closed stateTree: support separate (user-defined) icons for open / closed state

comment:2 Changed 12 years ago by bill

Resolution: fixed
Status: newclosed

(In [11699]) Add "opened" parameter" to getIconClass() callback, to support separate (user-defined) icons for opened/closed tree nodes, typically opened and closed folders. Fixes #5003.

comment:3 Changed 12 years ago by bill

(In [11700]) Changes spaces to tabs; had a weird editor setting in previous checkin. Refs #5003.

comment:4 Changed 12 years ago by bill

(In [11719]) Default opened and closed folder icons for tundra, designed by nikolaionken (CLA on file). Refs #5003. There's a little horizontal vertical line at the bottom right of the opened folder; not sure where it's coming from (it's not part of the new image files)

comment:5 Changed 12 years ago by bill

(In [11720]) Default leaf icon for tundra, designed by nikolaionken (CLA on file). Refs #5003. Also fixed rendering glitch (just had forgotten no-repeat on the image)

comment:6 Changed 12 years ago by bill

(In [11730]) Use gif not png, to be nice to IE6. Refs #5003.

comment:7 Changed 12 years ago by bill

(In [11797]) New folders icons from Nikolai (CLA on file). Refs #5003.

Note: See TracTickets for help on using tickets.