PDA

View Full Version : [CLOSED] How to find Y-Coordinate of a Tree panel selected node



mohan.bizbites
Jan 31, 2014, 11:49 AM
Hello Team,
we have a requirement of finding a Y-Coordinate of a selected node in tree panel,
Initially we are getting the dynamic value from database so that we have to select the tree node dynamically from code behind, here the problem is we are unable to get the dynamically selected tree nodes Y-Coordinate.
Thanks for your time!

Daniil
Jan 31, 2014, 11:59 AM
Hi @mohan.bizbites,

I don't quite understand why you need Y coordinate of a selected node, but:

Ext.fly(TreePanel1.selModel.selNode.ui.elNode).get Y()

Though, it might be better to select a node by its id, for example.

mohan.bizbites
Jan 31, 2014, 1:30 PM
Ext.fly(TreePanel1.selModel.selNode.ui.elNode).get Y()

Though, it might be better to select a node by its id, for example.



Hi danil thanks for reply,

getting error -" Cannot read property ui of undefined " after running script code 'var x= Ext.fly(TreePanel1.selModel.selNode.ui.elNode).get Y() '.

i am using 2.2 version.

Thanks

Daniil
Jan 31, 2014, 2:50 PM
It was a script for Ext.NET v1.

In v2 please try this:

var selectedNode = App.TreePanel1.selModel.getSelection()[0],
view = App.TreePanel1.getView();

Ext.fly(view.getNode(selectedNode)).getY();