Home > Class Reference > ENSLIB namespace > %ZEN.Component.dynaTree
Private  Storage   

%ZEN.Component.dynaTree


class %ZEN.Component.dynaTree extends component

This component draws an HTML tree control based on executing a user-provided callback method.
There are several ways that you can provide data for the tree control:

Inventory


Parameters Properties Methods Queries Indices ForeignKeys Triggers
5 19 31


Summary


Properties
%condition %import %includeFiles %page
%resource OnGetNodeInfo OnGetTreeInfo align
aux childIndent composite containerStyle
dataGlobal dragEnabled dropEnabled enclosingClass
enclosingStyle error height hidden
hint hintClass hintStyle id
imageContracted imageExpanded imageFolderClosed imageFolderOpen
imageNode index label labelClass
labelDisabledClass labelStyle name nodeCount
onafterdrag onbeforedrag onchange onclick
ondblclick ondrag ondrop onhide
onrefresh onshow onupdate parameters
parent selectedIndex showFolders showLabel
showLines slice text title
tuple valign value visible
width window

Methods
%AddToSaveSet %Attr %BindExport %ClassIsLatestVersion
%ClassName %ConstructClone %DispatchClassMethod %DispatchGetModified
%DispatchGetProperty %DispatchMethod %DispatchSetModified %DispatchSetMultidimProperty
%DispatchSetProperty %DrawComponentHTML %DrawHTML %DrawJSStrings
%EnclosingDivId %Eval %EvalC %Extends
%ForceClientRender %GetEventHandlers %GetImageDirectory %GetParameter
%GetXMLName %IsA %IsModified %MakeId
%New %NormalizeObject %ObjectModified %OnAddToPageAfter
%OnAddToPageBefore %OnDrawEnclosingDiv %OnDrawObjectProperties %OnObjectSynch
%OnZENDeserialize %OriginalNamespace %PackageName %QuoteValue
%QuoteValueL10N %RemoveFromSaveSet %Self %SerializeObject
%SetModified %ValidateObject XMLDTD XMLExport
XMLExportToStream XMLExportToString XMLNew XMLSchema
XMLSchemaNamespace XMLSchemaType dragFinishHandler dragHandler
dragNotifyHandler dragStartHandler dropHandler dropStartHandler
expandAll exposeComponent findElement fireOnUpdateEvent
getEnclosingDiv getHidden getHintElement getLabelElement
getNodeParent getNodeText getNodeValue getProperty
getSelectedIndex getSettings getType getValue
invokeSuper isNodeExpanded isOfType itemClicked
itemDblClicked makeId onCreate onDelete
onDisplayHandler onEndModalHandler onPopupAction onRefreshContents
onSerialize onStartModalHandler onloadHandler onunloadHandler
onupdateHandler refreshContents reloadNode render
renderContents renderSVG selectItem setHidden
setNodeStyle setNodeText setNodeValue setOverlayMode
setProperty startProgressBar stopProgressBar toggleExpanded

Subclasses
%DeepSee.Component.dsdynaTree

Parameters


• parameter IMAGECONTRACTED;
Default url of image used for contracted tree node. This is only used when showLines is false.
• parameter IMAGEEXPANDED;
Default url of image used for expanded tree node. This is only used when showLines is false.
• parameter IMAGEFOLDERCLOSED = "folderclosed.gif";
Default url of image used for closed folder nodes.
• parameter IMAGEFOLDEROPEN = "folderopen.gif";
Default url of image used for open folder nodes.
• parameter IMAGENODE = "node.gif";
Default url of image used for a leaf node in the tree.

Properties


• property OnGetNodeInfo as %ZEN.Datatype.delegator(FORMALSPEC="*tSC:%Status,&tParameters:%String,pLevel:%Integer,&pHandle:%String,pNodeInfo:%ZEN.Auxiliary.NodeInfo",RETURNTYPE="%Boolean");
Name of Server-side callback method to call to get information for each node of this tree.
This must be the name of a server-only method in the page class that contains this component.
• property OnGetTreeInfo as %ZEN.Datatype.delegator(FORMALSPEC="pRoot:%String,*pTree:%List,&tParameters:%String",RETURNTYPE="%Status");
Name of Server-side callback method to call to get information for the entire contents of the tree.
This is a lower-level callback than the OnGetNodeInfo callback. It lets you define the contents of the entire tree using a multi-dimensional array.
If this is defined then the OnGetNodeInfo callback is not used.
This must be the name of a server-only method in the page class that contains this component.
The callback method should be similar to this:
ClassMethod GetTreeInfo(pRoot As %String, Output pTree, ByRef pParms) As %Status
{
	#; top-most nodes are children of 0
	Set pTree(0,"ch",1) = ""
	Set pTree(0,"ch",2) = ""
	Set pTree(0,"ch",3) = ""
	#; each node supplies: $LB(caption, value, hasChildren, link, expanded, icon, tooltip, style)
	Set pTree(1) = $LB("Animal",1,1,"",1)
	Set pTree(2) = $LB("Mineral",2,1,"",1)
	Set pTree(3) = $LB("Vegetable",3,1,"",1)
	#; child nodes are placed under "ch"
	Set pTree(1,"ch",4) = ""
	Set pTree(4) = $LB("Cow",4,0,"",1)
	Quit $$$OK
}
• property childIndent as %ZEN.Datatype.length [ InitialExpression = 20 ];
Specifies amount child nodes should be indented. This value is only applied when showLines is false.
• property dataGlobal as %ZEN.Datatype.glvn;
If defined, and there is no user-defined OnGetNodeInfo callback method, then this is the name of a global that is used to provide the contents of this tree.
The global takes the form:
^glvn("A","B") = URL
The global subscripts define the node names; The URL value is a link that is used when the user clicks on the node.
• property imageContracted as %ZEN.Datatype.uri;
url of image used for contracted tree node (when showLines is false).
• property imageExpanded as %ZEN.Datatype.uri;
url of image used for expanded tree nodes (when showLines is false).
If you set this, make sure you also set imageContracted.
• property imageFolderClosed as %ZEN.Datatype.uri;
url of image used for a closed folder node in the tree.
If not specified, a default image is supplied.
• property imageFolderOpen as %ZEN.Datatype.uri;
url of image used for an open folder node in the tree.
If not specified, a default image is supplied.
• property imageNode as %ZEN.Datatype.uri;
url of image used for a leaf node in the tree.
If not specified, a default image is supplied.
• property nodeCount as %ZEN.Datatype.integer(XMLPROJECTION="none",ZENSETTING=0) [ InitialExpression = 0 ];
This is used to keep track of how many nodes are in this tree.
• property onchange as %ZEN.Datatype.eventHandler;
onchange event handler: If defined, this event is fired when the user changes the value of this component.
• property onclick as %ZEN.Datatype.eventHandler;
onclick event handler: If defined, this event is fired when the user clicks on an item
• property ondblclick as %ZEN.Datatype.eventHandler;
ondblclick event handler: If defined, this event is fired when the user double-clicks on an item
• property parameters as array of %ZEN.Auxiliary.parameter(XMLKEYNAME="paramName",XMLNAME="parameter",XMLPROJECTION="ELEMENT");
User-defined set of parameters. These values are passed on to the user callback function that provides the contents of this view. Typically this is used to hold search parameters.
• property selectedIndex as %ZEN.Datatype.integer [ InitialExpression = -1 ];
Index (0-based) of current selected tree node.
• property showFolders as %ZEN.Datatype.boolean [ InitialExpression = 1 ];
If true and showLines is false, display open and closed folder icons as well as icons for each node in the tree. The default is true.
If showLines is true, this property is ignored.
• property showLines as %ZEN.Datatype.boolean [ InitialExpression = 0 ];
If true, show dashed lines (as a series of images) between the nodes of the tree.
• property text as %ZEN.Datatype.string(XMLPROJECTION="none");
Text (display) value of current item within the view. Do not access this directly; use getProperty('text') instead.
• property value as %ZEN.Datatype.string(XMLPROJECTION="none");
Logical value of current item within the view. Do not access this directly; use getProperty('value') instead.

Methods


• method %DrawHTML()
Draw HTML for this component.
• classmethod %GetImageDirectory() as %String
Return the directory from which built-in images are supplied.
• method dragStartHandler(dragData) [ Language = javascript ]
Built-in drag handler for tree component. Let the user drag the selected node.
• method expandAll(flag) [ Language = javascript ]
Expand (if flag is true) or contract (if flag is false) all nodes within the true; Does not invoke any callback methods.
• method getNodeParent(nodeNo) [ Language = javascript ]
Return the index number (0-based) of the parent of the specified node. nodeNo is the index number of the node (0-based).
• method getNodeText(nodeNo) [ Language = javascript ]
Get the display value of a given node. nodeNo is the index number of the node (0-based). If nodeNo is not provided use the current selected noded.
• method getNodeValue(nodeNo) [ Language = javascript ]
Get the logical value of a given node. nodeNo is the index number of the node (0-based). If nodeNo is not provided use the current selected noded.
• method getSelectedIndex() [ Language = javascript ]
Return the index number (0-based) of the current node. Return -1 if no node is selected.
• method getValue() [ Language = javascript ]
Get the logical value of the current selected node.
• method isNodeExpanded(nodeNo) [ Language = javascript ]
This method returns the expanded state of a given nodeNo. true = expanded.
• method itemClicked(idx, level) [ Language = javascript ]
User clicked on an item. idx is index of node (0 based). level is indentation level of node (0 based); this is passed on to the callback.
• method itemDblClicked(idx, level) [ Language = javascript ]
User double-clicked on an item.
• method reloadNode(nodeNo) [ Language = javascript ]
Reload the child nodes of the given node. nodeNo is the index number of the node (0-based).
This method does nothing if it called for a leaf node (a node without children).
This method only works when the OnGetTreeInfo callback is used to supply the contents of the tree.
• method selectItem(idx) [ Language = javascript ]
Select the given node within the tree. idx is index of node (0 based).
• method setNodeStyle(nodeNo, style) [ Language = javascript ]
Set the css style for of a given node. style should contain css style declarations (e.g., 'color: red;')
nodeNo is the index number of the node (0-based).
• method setNodeText(nodeNo, text) [ Language = javascript ]
Set the display value of a given node. nodeNo is the index number of the node (0-based).
• method setNodeValue(nodeNo, value) [ Language = javascript ]
Set the logical value of a given node. nodeNo is the index number of the node (0-based).
• method setProperty(property, value, value2) [ Language = javascript ]
Set the value of a named property.
• method toggleExpanded(nodeNo) [ Language = javascript ]
Toggle the current expanded state of a given node within the tree. nodeNo is the index number of the node (0-based).