G23 Expandable Tree Widget

Definition

For heirarchical menus of nodes where branch nodes can be expanded or collapsed.


Usage

To be used as a hierarchical menu of nodes. Nodes may contain links or just plain text. Nodes may contain k02 DHTML Popup components.

The node tree's HTML is a set of arbitrarily nested <ul> and <li> elements. If a <li> contains an id attribute, e.g. <li id="foo"> and a page links to it using page.html#foo, that branch of the node, and its children, will be auto-expanded. Any <li class="default-expanded"> elements will be auto-expanded by default, otherwise they'll be collapsed.

Trees should be limited to under 100 nodes, otherwise increasingly long periods of high processor usage may be experienced, especially on Internet Explorer, due to the involved nature of the JavaScript used to setup this component.


Show all Templates

All Templates Referencing this Component

v0 Hierarchical Node Tree

Basic hierarchical node tree.

Copy the code below and paste into your text editor.

No Templates Reference this

v0 x1 Search Filter Example

This example is for use inside the sr03 component. It simply shows the formatting of search filter content within the g23 tree. When the node tree is used inside the sr03 component, you will see a few style changes to component elements.

Use of the results count [n,nnn] is optional.

Copy the code below and paste into your text editor.

Templates:

v0 x2 Hierarchical Node Tree w/ Auto-Expanding Controls

The addition of "multi" to the classname triggers the appearance of expand/collapse all controls for user convenience. "expand all" and "collapse all" text can be localized in menucontent.js.

Copy the code below and paste into your text editor.

No Templates Reference this

v0 x3 Hierarchical Node Tree w/ Current Node Hilighted

This example shows how to indicate the current node, which is done by using a <strong> element. This technique can be used on the g23v2 Static Hierarchical Node Tree.

Copy the code below and paste into your text editor.

No Templates Reference this

v1 Hierarchical Node Tree With Check Boxes

Hierarchical node tree with check boxes and behavior to auto-check children boxes and indicate hidden checked boxes. The check boxes must be the first child element of the list item, and not be wrapped in any other element. For example <li><span><input type="checkbox" value="foo"><span> Foo</li> will break the widget. Any list item may or may not contain a check box.

Copy the code below and paste into your text editor.

No Templates Reference this

v2 Static Hierarchical Node Tree

Non-interactive node tree. For situations where there are too many nodes to reasonably send to the client in a single page. As the user navigates the tree, the server sends back different representations of the tree using this component. There are three kinds of nodes: leaf nodes, expanded branch nodes, and collapsed branch nodes. These are coded as <li>, <li class="expanded branch">, and <li class="collapsed branch"> respectively.

Note: It's up to the server-side programmer to ensure the tree expands and collapses consistently across multiple page views.

Copy the code below and paste into your text editor.

No Templates Reference this

v2 x1 Static Hierarchical Node Tree w/ Expand and Collapse Links

The text labels "expand all" and "collapse all" can be localized or replaced with &#160; so just the icons appear.

Copy the code below and paste into your text editor.

No Templates Reference this

v2 x2 Static Hierarchical Node Tree where the links don't look like links

They're still links, but they just don't look like links so as not to overwhelm the user. However leaf node links will appear as links. Also, if JavaScript is turned off, the links will look like links, since the plus/minus won't be active.

Copy the code below and paste into your text editor.

No Templates Reference this

Contact About Sun News & Events Employment Site Map Privacy Terms of Use Trademarks Copyright 1994-2006 Sun Microsystems, Inc.