Ext. Tree. treepanel

Source: Internet
Author: User
Main configuration items:
Root: the root node of the tree.
Rootvisible: whether to display the root node. The default value is true.
Usearrows: Specifies whether to use the Vista arrow in the tree. The default value is false.
Lines: whether to display tree lines. The default value is true.
Loader: The loader of the Tree node. The default value is Ext. Tree. treeloader.
Selmodel: Specifies the tree selection mode. The default value is Ext. Tree. defaultselectionmodel.
Pathseparator: the delimiter of the Tree node path. The default value is "/".
Singleexpand: whether to expand only one node in the tree at a time. The default value is true.
Requestmethod: Request Method. Optional values include post and get.
Containerscroll: whether to register the tree panel to the scroll manager scrollmanager.

Main Methods:
Collapseall (): shrinks all Tree nodes
Expandall (): Expand All Tree nodes
Getrootnode (): Get the root node
Getnodebyid (string ID): Get the node with the specified ID
Expand ([Boolean deep], [Boolean anim], [function callback], [object scope])
Expandpath (string path, [String ATTR], [function callback])
Getchecked ([string attribute], [treenode startnode])
Selectpath (string path, [String ATTR], [function callback])
Getselectionmodel ():

2. Ext. Data. Node
Main configuration items:
ID: node ID
Leaf: whether the current node is a leaf node

Main attributes:
ID: node ID
Attributes: a set of node attributes
Parentnode: the parent node of the current node.
Childnodes: array composed of all child nodes of the current node
Firstchild: the first direct subnode of the current node. If not, it is null.
Lastchild: The last direct subnode of the current node. If not, it is null.
Nextsibling: The next sibling node of the current node. If not, the value is null.
Previussibling: the first brother node of the current node. If not, it is null.

Main Methods:
Appendchild (node/array node): append a new subnode.
Bubble (function FN, [object scope], [array ARGs]): calls a specified function iteratively from the current node. If the specified function returns false, the iteration is terminated.
ARGs: input function parameters. The default value is the current node.
Cascade (function FN, [object scope], [array ARGs]): calls a specified function iteratively from the current node. If the specified function returns false, the iteration is terminated.
Contains (node): determines whether the current node contains the specified child node.
Eachchild (function FN, [object scope], [array ARGs]): calls a specified function for all subnodes of the current node to iterate. If the specified function returns false, the iteration is terminated.
Findchild (string attribute, mixed value): searches for the first subnode with the specified attribute.
Findchildby (function FN, [object scope]): searches for the first child node that meets the requirements based on the custom function. If the custom function returns true, the matching is successful.
Getdepth (): Get the depth of the current node. The root node depth is 0.
Getownertree (): obtains the tree of the current node.
Getpath ([String ATTR]): obtains the path corresponding to the current node. Program It can be used to expand or select nodes.
ATTR: the attribute used to find the path. The default value is the node ID.
Haschildnodes (): Indicates whether a subnode exists.
Indexof (node): gets the index value of the specified sub-node.-1 is not found.
Insertbefore (node, node refnode): Insert a new subnode before the specified subnode of the current node.
Node: The new node to be inserted.

isancestor (node): determines whether the specified node is the parent node of the current node (it can be a parent node of any level ).
isfirst (): whether it is the first child node of the parent node.
islast (): whether it is the last child node of the parent node.
isleaf (): whether it is a leaf node.
item (number index): The subnode that obtains the specified index.
remove (): deletes the current node from the parent node.
removechild (node): deletes the specified child node of the current node.
replaceChild (node newchild, node oldchild): replace the specified child node of the current node with the new child node.
sort (function FN, [object scope]): Use the specified sorting function to sort the subnodes of the current node.

3. Ext. Tree. treenode
Main configuration items:
Text: Text Information on the node
QTip: prompt information on the node
Icon: path corresponding to the node icon
Iconcls: The style applied to the node Map
Checked: Select status of the current node
True: A check box in the selected status is displayed before the node.
False: displays an unselected check box before the node.
Do not specify this value: no check box is displayed
Href: Connection attribute of a node. The default value is #
Hreftarget: displays the target framework of node connection.
Editable: whether to allow editing. The default value is true.
Expanded: whether to expand a node. The default value is false.
Disabled: whether to disable a node. The default value is false.
Singleclickexpand: whether to expand a node by clicking
Allowchildren: whether to allow the current node to have subnodes. The default value is true.
Expandable: whether to display a plus or minus icon when no subnode is included. The default value is false.
Uiprovider: Ui class of the node. The default value is Ext. Tree. treenodeui.

Main attributes:
Text: Text Information on the node
Disabled: whether the current node is disabled

Main Methods:
Collapse ([Boolean deep], [Boolean anim], [function callback], [object scope]): contract the current node
Deep: whether to cascade and contract all subnodes
Collapsechildnodes ([Boolean deep]): shrinks all subnodes.
Disable (): Disable the current node
Enable (): enable the current node
Ensurevisible ([function callback], [object scope]): ensure that all parent nodes are expanded.
Expand ([Boolean deep], [Boolean anim], [function callback], [object scope]): expand the current node
Expandchildnodes ([Boolean deep]): expands all subnodes.
Isexpanded (): whether to expand the current node
Isselected (): whether the current node is selected
Select (): select the current node
Settext (string text): set the current text
Toggle (): switches the expansion and contraction statuses of the current node.
Unselect (): cancels the selection of the current node
Getui (): Get the node UI object

4. Ext. tree. asynctreenode
main configuration items:
Loader: The Tree loader of the current node. By default, the tree loader configured in the tree is used.
main method:
isloaded (): whether the current node has loaded data
reload (function callback, [object scope]): Reload the node data and call the callback function

5. Ext. tree. treenodeui
main method:
getanchor (): gets the element of the focus from the node UI
geticonel (): element
gettextel (): Get text node
addclass (string/array classname):
removeclass (string/array classname ):
hide ():
show ():
ischecked (): gets the node selection status, if the current node does not have a check box, the function returns false
togglecheck (Boolean (optional): sets the node check box selection status

6. Ext. Tree. roottreenodeui

7. Ext. Tree. defaultselectionmodel
Is the default selection mode of treepanel. In this mode, only one node in the tree can be selected at a time.

Main Methods:
Clearselections (): clears the selection of all nodes in the tree.
Getselectednode (): gets the currently selected node
Isselected (treenode node): whether the node is selected
Select (treenode node): select a specified Node
Unselect (treenode node): cancels the selected status of a specified node.
Selectnext (): select the next node of the currently selected node
Selectprevious (): select the previous node of the currently selected node

8. Ext. Tree. multiselectionmodel
Is the multi-choice mode of treepanel. You can select multiple nodes in the tree at a time in this mode.

Main Methods:
Clearselections (): clears the selected status of all nodes.
Getselectednodes (): gets an array composed of the selected nodes.
Isselected (treenode node): whether the node is selected
Select (treenode node, [eventobject E], Boolean keepexisting): select the specified Node
Unselect (treenode node): cancels the selected status of a specified node.

9. Ext. Tree. treeloader
The latency Loading Function of subnodes is provided. The URL address specified by the request returns the data of the subnode. The returned data format is as follows:

[
{
ID: 1,
Text: "node1 ",
Leaf: True,
Check: false
},
{
ID: 2,
Text: "node2 ",
Children :[
{
ID: 3,
Text: "node3 ",
Leaf: True
}
]
}
]
When the tree node is expanded, the ID of the current node is sent to the server as a request parameter, which can be obtained through the node parameter name on the server.

main configuration item:
dataurl: obtains the URL of a subnode.
baseattrs: basic attribute object of a subnode. attributes of this object are added to all subnodes created by the tree loader. The attribute value of the same name returned by the priority server.
baseparams: basic request parameters. These parameters are appended to each node's request.
clearonload: whether to remove existing subnodes before loading. The default value is true.
preloadchildren: determines whether to recursively load all subnodes after the first time the subnode is loaded.
requestmethod: Request Method. Optional values: Post and get.
uiproviders: the UI implementation class used by the loader to create sub-nodes.
URL: Same as dataurl.

Main Methods:
Load (ext. Tree. treenode node, function callback, (object) Scope): load the tree node from the specified URL.
Node: The Tree node for which the child node needs to be loaded.

10. Ext. Tree. treeeditor
Main configuration items:
Alignment: alignment.
Editdelay: the delay time for two click nodes to trigger the editing operation. The default value is 350 milliseconds.
Hideel: whether to hide the binding element when the editor component is displayed.
Maxwidth: the maximum width of the editor. The default value is 250.

11. Ext. Tree. treesorter
main configuration item:
property: name of the node attribute used for sorting. The default value is text.
dir: Sorting direction. The optional values include ASC and desc. The default value is ASC.
casesensitive: case sensitive. The default value is false.
foldersort: determines whether a leaf node is placed under a non-leaf node. The default value is false.
leafattr: the value of the leaf node in folder sorting. The default value is leaf.
sorttype: a custom function is used to convert node values before sorting.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.