Hi There,
I'm having some issues with a TreeView control in my UI that I cannot seem to resolve, and thought I would ask if anybody here has done this type of thing. My TreeView is made up of a collection of nodes, each with some child items. When the window containing the TreeView displays, I populate it with the nodes. I want to be able to script the selection within the TreeView, but I want the script to select a child items, not just their parent nodes. Is this possible? I know it is possible to selecting the parent nodes in a TreeView, but I cannot seem to get the code for selecting, via scripting, a child item of a node in a TreeView. Any thoughts on how to acheive this?
Thanks for your time and help!
Best,
Arie
Here is some of the code I am using for auto-selecting child items of nodes in the TreeView:
//Code to populate the TreeView (picker) goes here
...
//Highlight the last selection
for (var i=0; i < picker.items.length; i++)
{
if (picker.items[i].title == SAVED_TITLE){
picker.selection = picker.items[i];
picker.selection.expanded = true;
for (var x=0; x < picker.selection.items.length; x++) {
if (picker.selection.items[x].marker == SAVED_MARKER){
picker.selection = picker.selection.items[x]; //turns out the indices are relative to it's parent, not the picker's indices
break;
}
}
break;
}
}