在flex中,默认点击▽才会展开或者关闭。如何在选中某项时,也可以展开或关闭呢?具体代码实现如下:
public function treeClick(event:Event):void { var item:XML = myTree.selectedItem as XML; var isOpen:Boolean = myTree.isItemOpen(item); myTree.expandItem(item, !isOpen); }
在flex中,默认点击▽才会展开或者关闭。如何在选中某项时,也可以展开或关闭呢?具体代码实现如下:
public function treeClick(event:Event):void { var item:XML = myTree.selectedItem as XML; var isOpen:Boolean = myTree.isItemOpen(item); myTree.expandItem(item, !isOpen); }