I am having some trouble setting the selected Node in a Tree.  I’ve see the previous posts on this and am still not able to get this to work.  What I am doing is as follows:  I have a Tree that the nodes are draggable to a datagrid. Now I want to take the node from the datagrid , drag-and-drop into another component, and have my tree get updated to the proper node.  I have taken some code that I found on another post related to opening the nodes in a tree and have come up with this.

 

function updateSelNode(event){

                                    var i:Number=0;

                                     var node:mx.controls.treeclasses.TreeNode=navCtrl.getTreeNodeAt(i);

                                       while (node != undefined){

                                                if (node  == event.selectedNode){

                                                //mx.controls.Alert.show("Node Matched");

                                                  navCtrl.selectedNode = event.selectedNode;

                                                 node = undefined;

                                                }

                                                else{

                                                            node = navCtrl.getNodeDisplayedAt(i);

                                                }

                                                i++;

                                    }

                         }

 

 

When I drag my Node from the Datagrid, this event is fired, but the (node  == event.selectedNode ) portion if statement is never

met.



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to