[Users] Find name of the checked node

5 views
Skip to first unread message

Robert Buckley

unread,
Mar 13, 2012, 5:51:49 AM3/13/12
to us...@geoext.org
Hi,

I am stuck trying to modify my WMSgetFeatureinfo popup.
I´m using the treenode radio plugin to construct a layer tree. When the node is checked the attributes are read into the popup, but the title is feature.id. Instead I would like to have the layer name as the title so I have to iterate through the tree and find the node which is currently checked...

my feeble attempt doesn´t work...

//Loop through each Group of Layers
for (var i=0; i<=(layerRoot.childNodes.length -1); i++)
{
//Check for base layer, if so do this differently
if (layerRoot.childNodes[i].checked == true)
{alert("test");
}
}

can anyone offer a solution?

cheers,

Rob

Robert Buckley

unread,
Mar 13, 2012, 6:28:05 AM3/13/12
to us...@geoext.org
Instead I just programmatically selected the node which is checked 

activeNode.select.defer(100, node);

and used...
 var tree = Ext.getCmp("treePanel"); 
 var selectedNode = tree.getSelectionModel().getSelectedNode();

..to read the name of the selected node.

If anyone knows how to miss out the second step and directly find the checked node, I´d be curious as to how it works.

yours,

Rob


Von: Robert Buckley <robertd...@yahoo.com>
An: "us...@geoext.org" <us...@geoext.org>
Gesendet: 10:51 Dienstag, 13.März 2012
Betreff: [Users] Find name of the checked node
_______________________________________________
Users mailing list
Us...@geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/users


Reply all
Reply to author
Forward
0 new messages