Hi all,
I would like to modify the root of a tree and save the old one to be able to switch display.
I have an xml view containing my tree:
<core:View xmlns:core="sap.ui.core" xmlns:layout="sap.ui.layout" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" xmlns:cmn="sap.ui.commons" xmlns:cc="cleanproject.custom" xmlns:mod="sap.ui.model" controllerName="cleanproject.TreeTest" xmlns:html="http://www.w3.org/1999/xhtml"> <cc:ComplexTree id="tutu" nodes="{ path:'/' }" title="{@code} {@name} {@version} "> <cc:ComplexTreeNode text="{@name} type {@type}" nodeType="{@type}"> <cc:layouts> <layout:HorizontalLayout> </layout:HorizontalLayout> </cc:layouts> </cc:ComplexTreeNode> </cc:ComplexTree> <cmn:Button press="showall" text="showall"></cmn:Button> <cmn:Button press="hideall" text="hideall"></cmn:Button> <cmn:Button press="toggleall" text="toggleall"></cmn:Button> <cmn:Button press="changeRoot" text="changeRoot"></cmn:Button></core:View Button press="changeRoot" text="changeRoot"></cmn:Button></core:View>
I would like when pressing "changeRoot" button the following behavior :
-Finding the selected TreeNode
-Saving the whole tree/the root?
-Set the selected TreeNode as the root
-Possibility to come back and display the previous Root
any suggestion ?
Thanks for helping & reading,
Regards,
Marc