Hi,
Thanks for the code.
I have a treepanel which has (or will have) over 100 layers. In order that the
user can find a layer quicker I wanted to develop I little search tool which
will iterate through the treepanel looking for the search string and match it
with the treenode.text (name of the layer). When matches are found these should
be listed so that the user can click on one of the results, open the parent and
display the layer.
Quite a tall order.
yours,
Rob
________________________________
Von: "[email protected]" <[email protected]>
An: [email protected]
Gesendet: 9:57 Mittwoch, 14.März 2012
Betreff: AW: [Users] Treepanel node search?
Hi Robert
I'm not sure, what you are looking for. Probably your are looking for something
else, but I post some code that I use to crawl trough a tree an do something
with the leaves. Maybe it will help you
Regards
Peter
var rootNode=layerTree.getRootNode();
rootNode.eachChild(function (myNode) {
myNode.collapse();
myNode.eachChild(function (n) {
for (i=0; i < n.layer.params.LAYERS.length; i++) {
if (n.layer.params.LAYERS[i] == n.text ) {
n.setText( 'test');
}
}
n.disable();
});
});
Von:[email protected] [mailto:[email protected]] Im Auftrag von
Robert Buckley
Gesendet: Mittwoch, 14. März 2012 08:44
An: [email protected]
Betreff: [Users] Treepanel node search?
Hi,
Has anyone developed a simple treepanel search which iterates through a
treepanel and finds the node.text?
I can iterate through, but am not sure how to get the results to do anything
usefull....ie..if 5 results are found, it would be necessary to then either
open parent container , switch visibility to true and zoom to extent for the
selected node.
Any help would be great,
cheers,
Rob_______________________________________________
Users mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/users