Expand All
Private Function ExpandAll (): void
{
Treemenu.dataprovider is a data source that is bound by ID Treemenu is a xmllist
For each (Var item:xml in Treemenu.dataprovider)
Treemenu.expandchildrenof (item,true);
}
All collection
Private Function CollapseAll (): void {
For each (Var item:xml in Treemenu.dataprovider)
Treemenu.expandchildrenof (Item,false);
}
Expand MO Node parameter item is an XML object
Treemenu.expandchildrenof (item,true);
Check item2 node is an XML object
Treemenu.selecteditem = item2;
3. Move the scroll bar to the corresponding node after locating the node in the tree component: A method for Tree.scrolltoindex (index)
Select node
Tree.selecteditem = Fieldnode;
Set scroll bar to scroll to the appropriate position
var index:int = tree.selectedindex;//The position of the current node
Tree.scrolltoindex (Index)//scroll bar to the position of the current node
Method 2: Set the scroll bar to scroll to the appropriate location:
Tree.verticalscrollposition = Position
Api:
Verticalscrollposition |
Property |
|
Verticalscrollposition:number []
The offset from the top edge to the content. This can be a pixel offset in some subclasses, or some other metric, such as the number of rows in a list or the number of tiles in TileList.
The default value is 0.
This property can be used as the source for data binding.
Tree Expand All you can also use the following method:
Tree.openitems = Item//item data to expand
Tree.openitems = [];//all collection
In the API:
Openitems:object []
A project that has been opened or has been set to open.
The default value is null.