-
Searching in a Treeview (scripting)
Hi, I am trying to create a dynamic treeview, that can have several nodes and each of those can several childnodes deep.
I want to be able to search the entire tree for a specific string. So say I want to see if the word “test” is already the name of one of the nodes in the tree.
How would I do that?! I’ve been trying different things for 2 days now without much success. I tried to add all the names to an array, but don’t know how to get all of them.
I was doing something like (PseudoCode):
add Tree.items to Array
add Tree.items[0].items to Array
add Tree.items[0].items[0].items to Array
add Tree.items[0].items[1].items to ArraySince I don’t know how complex the tree is in any given case, this becomes complex very quickly. I’ve tried various loops but without any success.
I hope someone has some ideas, how to work with this!
Thanks,
Neil