I am using Treegrid widget of smartgwt.
I want to copy selected(partial) tree structure(leaf node to root node) from existing Treegrid to other TreeGrid.
I got ID's of selctedPath like "4/135/1456" from TreeGrid and Name of selected leaf node.
TreeGrid requires dataUrl( xml ) How to pass data of selected(partial) tree structure to 2nd TreeGrid ? Is there any API for this case ?
User can add different partial tree in 2nd TreeGrid.
How to set this data to 2nd TreeGrid ?
Any help or guidance in this matter would be appreciated.
On your first TreeGrid use the getTree() methods to retrieve its underlying Tree object. There, use the available methods to retrieve an array of TreeNode objects for the required nodes you want to move over to the 2nd TreeGrid, e.g. getParents(TreeNode node), getDescendants(TreeNode node) etc. On the 2nd TreeGrid you can again call the getTree() and there use the add nodes methods, like the addList(TreeNode[] nodeList, TreeNode parent).