Tree view object is basically used to view folders and files on the server and explore them. You can add items to it one by one or load them as XML document.

Tree view object constructor takes three parameters:
new TTreeView(title, height, width);
Use loadXML method to load items from XML document.
In the previous example, we created an XML document (xmlDoc) using build in function loadXMLString which takes an XML string as argument and passed the document to the tree view object using loadXML method.
Tree View Methods and Properties| Method/Property | Description |
|---|---|
| add | Adds a new item to the tree view object. Form: add(itemId, type, title, parentId) Example: treeView.add('fold1', 'Folder', 'Folder 1', 'root'); |
| alignTitleLeft | Positions title text to left. Default value in center |
| alignTitleRight | Positions title text to right. Default value in center |
| clear | Clears the tree view object from all items |
| getSelectedItem | Gets selected item id |
| loadXML | Load XML data to the tree view. This method takes XML document as an argument. |
| setOnFileDblClick | Sets an event handler for the double click event on items of type file. Form: setOnFileDblClick(eventHandler) |
| setOnSelectedItemChanged | Sets an event handler for the selected item changed event on the tree view object. Form: setOnSelectedItemChanged(eventHandler) |