Hardaur,

My code is working perfectly with trick myTree.selectedIndex=-1; Hope 
it will help you if you are still in tree node de-selection problem;

if(myTree.isItemOpen(selectedNode)){
myTree.expandItem(selectedNode, false, true);
myTree.selectedIndex =-1;
}else{
myTree.expandItem(selectedNode, true, true);
myTree.selectedIndex =-1;
}
                                }

Regards,
Mubasher

--- In [email protected], "mubasherhaneef" 
<[EMAIL PROTECTED]> wrote:
>
> Hi Hardaur,
> 
> Your code just start working but now I am in the same problem that 
> you were in; Have you sorted out the problem 
> (http://tech.groups.yahoo.com/group/flexcoders/message/86441
> )? 
> 
> Thanks for the earlier help;
> 
> Regards,
> Mubasher
> 
> --- In [email protected], "mubasherhaneef" 
> <mubasherhaneef@> wrote:
> >
> > I tested your code but didn't get good luck with that as-well. I 
am 
> > still trying to open my tree node from folder icon instead of 
> > triangle; I used expandItem method but on my tree node click 
event 
> > for some reason it opens all the nodes of the tree.
> > 
> > 
> > --- In [email protected], "hardaur55" <gander@> wrote:
> > >
> > > Mubasher,
> > > 
> > >   Hi, I'm doing the same thing you are.  You can see some code 
> that
> > > makes it happen at
> > > http://tech.groups.yahoo.com/group/flexcoders/message/86441
> > > 
> > > However, you'll run into the same problem I am : (
> > > 
> > > H
> > > 
> > > 
> > > --- In [email protected], "mubasherhaneef"
> > > <mubasherhaneef@> wrote:
> > > >
> > > > I have a question regarding opening of tree branch node;
> > > > 
> > > > In a tree, a branch node can contain multiple child nodes, 
and, 
> > by 
> > > > default, appears as a folder icon with a disclosure triangle 
> that 
> > > > lets users open and close the folder but I was trying to open 
> > child 
> > > > node/folder, when user will click either on triangle or on 
> folder 
> > > > icon.
> > > > 
> > > > I tried the below mentioned code but that expands all the 
nodes 
> > > > children of tree instead of expanding one node children;
> > > > 
> > > > Any help, suggestions or code example should be appreciated.
> > > > 
> > > > Regards,
> > > > 
> > > > Mubasher
> > > > 
> > > > 
> > > > 
> > > > <mx:Script>
> > > > <![CDATA[
> > > > 
> > > > public function treeChanged(event:Event):void {
> > > > selectedNode=Tree(event.target).selectedItem as XML;
> > > > 
> > > > if([EMAIL PROTECTED] == "My node"){
> > > >    //myTree.expandItem(treeData,true);
> > > >    myTree.expandChildrenOf(myTree.dataProvider[0],true);
> > > > }
> > > > 
> > > > ]]>
> > > > </mx:Script>
> > > > 
> > > >                          
> > > > <mx:XML id="treeData">
> > > > <node label="root Node">
> > > > <node label="My node">
> > > > <node label="myNode1" data="myNode1"/>
> > > > <node label="myNode2" data="myNode2"/>
> > > > <node label="myNode3" data="myNode3"/>
> > > > </node>
> > > > <node label="My Profile">
> > > > <node label="Change Password" data="password"/>
> > > > <node label="Personal" data="personal"/>
> > > > <node label="Contact Info" data="contact"/>
> > > > </node>
> > > > </node> 
> > > > </mx:XML>
> > > > 
> > > > <mx:Tree id="myTree" width="100%" height="100%" 
> > labelField="@label"
> > > > backgroundColor="#BEC7CC" showRoot="true" 
useHandCursor="true" 
> > > > dataProvider="{treeData}" change="treeChanged(event)"/>
> > > >
> > >
> >
>


Reply via email to