PDA

View Full Version : ExtJS 4 alternative to node.getOwnerTree



dee1
14 Feb 2012, 7:35 AM
We're converting an ExtJS3 app to ExtJS4.
In V4 is there an equivalent function or approach to the V3 node.getOwnerTree()?

For example, our V3 code passes the Node Id and Tree Id as follows:

nodeId = node.id
treeId = node.getOwnerTree().getId()


function processNode(treeId, nodeId) {
var node = Ext.getCmp(treeId).getNodeById(nodeId);
..
}

mitchellsimoens
14 Feb 2012, 8:49 AM
No. You will need to resolve the tree some other way, a reference is not put onto the nodes.

dee1
14 Feb 2012, 4:17 PM
Are you able to provide any tips on the other ways to achieve this?

As a background:
Our V3 app has extended the TreeNodeUI to provide html form elements (eg drop down lists) embedded in the node text which pass the Node Id & Tree Id to functions.
For V4 we've extended the Ext.tree.Column to achieve this and just need to be able to pass the tree/ node ids.

In other cases for V4, only the model node is available, for example:
For a Tree Panel checkchange listener, the node is passed.
In this case, how should the Tree Id be accessed from the checkchange listener (as the app accesses other tree data)?


items:[{


id : 'panel1',
xtype : 'treepanel',
store : store1,

listeners : {
checkchange : function(node, checked, eOpts) {
..
}
}

}]


As this is needed for our V3 to V4 migration, any suggestions on the alternatives to the getOwnerTree() functionality to resolve the tree in V4 would be very helpful.

dee1
14 Feb 2012, 7:34 PM
Similar issue over here http://www.sencha.com/forum/showthread.php?179814-How-to-get-the-owner-tree-of-a-node

Will continue discussion on that thread.