I currently have an Ultraweblistbar, with multiple groups, each containing a WebTree within.
The problem that I am encountering, is that if a user chooses an item in two distinct groups - they both show up highlighted when we only require the last item clicked to be highlighted. To remove the previously selected item, I was going to use the Code below, to traverse through all nodes and turn off any selected items before reselecting the recent click.
removePrevSelNodes(iglistbarTree.getNodes())
for (var i = 0; i < nodes.length; i++) {
}
alert(nodes[i].getText())
removePrevSelNodes(nodes[i].getChildNodes());
unfortunately, this only gives me acces to the CURRENT tree clicked, and I cannot reach the other tree's, or groups and turn off their selected nodes.
So I decided to try and get the Groups collection from the Ultraweblistbar. After much research, it appears I had to create a clientside eventhandler for the list bar's initializeListBar event, and create a variable with the Listbar object in it.
var myListBar;
myListBar = oListbar;
I could then access the Group collection on the client via this statement; myListBar.Groups.
However, I don't seem to be able to retrieve the Child Tree objects from each of the Groups in the Collection - am I missing something here?
I realise that there are a number of other ways I could perform this, I could go back to the server, but am trying to avoid it. I could also have a hidden page variable, that contains the name of the last clicked Node, and each time update it with the latest click, after turning the previous node off. Unless i'm missing something however, this should all be possible, and fairly easy from the Client side object model?
Thanks in advance,
Try:
function DeselectMenu(treeId) { var group, item; for (group in igtree_treeState) { for(item = 0; item < igtree_treeState[group].getNodes().length; item++) { if(treeId != group) { igtree_treeState[group].getNodes()[item].setSelected(false); } } } }