RasterTree( parent, icon, text )

Creates a tree control. Tree controls take the entire area of their parent container. The RasterTree class extends the RasterTreeItem class, thus all RasterTreeItem methods apply to the RasterTree object.

The following code creates a tree control inside a document element with an id of "treeDiv":
var mytree = new Tree( "treeDiv", ICONS16.COMPUTER, "My System");

mytree.add( ICONS16.BOOK_OPEN, "Help Topics"); //add 1st item

var item = mytree.add( ICONS16.CALENDAR, "Add Event"); //add 2nd item
item.add( ICONS16.PAGE, "Birthday Party"); //add child in 2nd item above
The icon URL might be prefixed by Raster resource-folder tag. The prefix "IMG:" is replaced with the current raster/images location, for example: "IMG:icon.gif" resolves to "$RASTER_HOME$/images/icon.gif". The prefix "CSS:" is replaced with the current css themes images location, for example: "CSS:icon.gif" resolves to "$RASTER_HOME$/themes/$THEME$/images/icon.gif".

Do not place a "/" between the prefix and the rest of the URL, as a forward slash will be inserted automatically. For configuring the RASTER_HOME and THEME use the Raster.config() method.

Parameters

Name Type   Description
parent object A string containing the ID of a DOM element, a DOM element object, or another RasterControl object. If this argument is null, the tree is created but not attached to the DOM herarchy; RasterControl.setParent() must be invoked later to specify the parent container.
icon string String containing path of a 16x16 image file or an object that implements the IID_SPRITEINFO interface such as the constants in the ICONS16 object. Set to null if no icons is desired.
text string Text shown in the root item; set to null for is no text is desired.

See Also

Home Examples Download License
 
Copyright © 2010-2017 Edwin R. López