I am trying to get the top parent from a child node, however the getRoot() always returns the very first root and not the root of the child:
if I call getRoot() from a 'usercopy' node, then the root returned is the 'user' node and not the 'usercopy' node.
How can I get the correct root node ?
onClick:function(node){
var top = $(this).tree('getRoot', node.target)
}
[ { id: 'user',
text: 'User',
iconCls: 'icon-user',
state: 'open',
children: [ [Object], [Object] ],
attributes: { vpath: 'user' } },
{ id: 'usercopy',
text: 'User',
iconCls: 'icon-user',
state: 'open',
children: [ [Object], [Object] ],
attributes: { vpath: 'usercopy' } } ]