xTree API

WebFXTreeAbstractNode

Abstract object with common functions and methods shared by WebFXTree and WebFXTreeItem. The two of those inherites from this object.

Constructor

Abstract object - no instances of it should be created

Properties

NameTypeDescription
idNumberRead only property that can be used to find the related HTMLElement. It can also be used the other way around. If you know the id of the HTMLElement you can get the JS object by looking in the webFXTreeHandler.all collection.
textStringThe text label for the node.
actionStringThe action (uri) associated with the node.
openBooleanRead only. Boolean property that tells if the node is expanded or collapsed (will always return false if there are no child nodes).
iconStringImage file to use as icon. Uses default if not specified.
openIconStringImage file to use as the open icon (if child nodes only). Uses default if not specified.
parentNodeReferenceA reference to the parent node.
childNodesArrayCollection of references to all child nodes.

Methods

NameReturnsDescription
add(oNode, [bNoIdent])ReferenceAdds a tree item to the current item. This method takes two argument, the first is the WebFXTreeItem object to add and the second is an optional boolean value, that if specified and set to true will prevent the tree from executing the indent method automatically once the node has been added. This parameter has no effect on calls to the add method before the tree is rendered, but settings this flag when adding nodes after the tree has been rendered will greatly reduce the time needed to complete the operation, this can be quite useful while adding more than one node at a time, but requires that the indent method is manually executed on the top most node affected by the changes afterwards. Returns a reference to the added node.
indent()VoidRedraws the traces between nodes and makes sure the tree is properly layed out.
toggle()VoidToggles the expand/collapse.
expand()VoidExpands the tree item.
collapse()VoidCollapses the tree item.
expandAll()VoidExpands the tree item and all sub items recursively.
collapseAll()VoidCollapses the tree root and all sub items recursively.
expandChildren()VoidExpands all sub items recursively (same as executing expandAll and the collapse).
collapseChildren()VoidCollapses all sub items recursively (same as executing collapseAll and the expand).
getNextSibling()ReferenceReturns a reference to the next sibling.
getPreviousSibling()ReferenceReturns a reference to the previous sibling.
toString()StringGenereates the HTML string needed to render the tree item.

WebFXTree

The WebFXTree object is used to create the actual tree root that can later be populated with tree items. All properties and methods from the WebFXTreeAbstractNode are inherited.

Constructor

new WebFXTree([text], [action], [behavior])
NameTypeDescription
textStringOptional. The text label for the tree root.
actionStringOptional. The action (uri) associated with the tree root.
behaviorStringOptional. Name of the behavior to use, check the setBehavior() method for details.
iconStringOptional. Image to use as the icon.
openIconStringOptional. Image to use as the open icon.

Properties

NameTypeDescription
renderedBooleanFlag that indicates whatever or no the tree has been generated and rendered.

Methods

NameReturnsDescription
getSelected()ReferenceReturns the id of the selected object, if any.
setBehavior(sBehavior)VoidHas to be specified before the tree is created and can be used to change the way the tree behaves, possible values are classic (default) and explorer. Check the usage page for more information about this.
getBehavior()StringReturns the name of the behavior used.

WebFXTreeItem

Used to create tree items, can be added (uisng the add method) to a WebFXTree or to another WebFXTreeItem object. All properties and methods from the WebFXTreeAbstractNode are inherited.

Constructor

new WebFXTreeItem([text], [action], [parent], [icon], [openIcon])
NameTypeDescription
textStringOptional. The text label for the tree item.
actionStringOptional. The action (uri) associated with the tree item.
parentReferenceOptional. Reference to an object to witch the node should be added.
iconStringOptional. Image to use as the icon.
openIconStringOptional. Image to use as the open icon.

Properties

NameTypeDescription
None but the inherited ones

Methods

NameReturnsDescription
getFirst()ReferenceReturns a reference to the first child node, if any.
getLast()ReferenceReturns a reference to the last child node, if any.

转载于:https://www.cnblogs.com/jeep/archive/2010/07/20/1781759.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值