Hi Gagan,

the only problem is that the dataprovider is empty when i get into the
clickedItem() function .

On Oct 5, 8:44 am, GAGAN anand <[email protected]> wrote:
> Hi Henry,
>
> Now in clicked Item function use ur tree data provider which is XMLList or
> XML whatever. I mean to say in for each loop use tree dataprovider. Then the
> child XML will be from the dataprovider. Then it will expand the node of
> that child.
>
> private function clickedItem():void{
>
>          selectedXml = treeDP.selectedItem;
>          for each (var child:XML in *treeDataprovider*)
>          {
>          if
> (child..model_chain.contains(selectedXml)||child.contains(selectedXml)||chi 
> ld.model_chain..task.contains(selectedXml))
>          {
>                     tree.expandChildrenOf(child,false);
>                     len = selectedXml.childIndex();
>                     trace(len);
>                     expandConcernedNode(selectedXml);
>           }
>          }
>
> }
>
> Hope you got it now.
>
> Regards
> Gagan Deep
>
> On 5 October 2011 02:06, helpdesk <[email protected]> wrote:
>
>
>
>
>
>
>
>
>
> > Hello Gagan,
>
> > could you explain more on the clickedItem()? i really don't understand
> > what you mean by me traversing the selectedXML through tree
> > dataprovider? Any small code snippet?
>
> > On Oct 4, 3:13 pm, GAGAN anand <[email protected]> wrote:
> > > Hi Henry,
>
> > > I also faced the same issue in my project. I got one solution to this.
>
> > > In method clickedItem(), you are traversing through the XML. Instead you
> > can
> > > take the selectedXML and traverse it through tree dataprovider i.e.
> > XMLList
> > > and then use that to expand the child of that node of tree.
>
> > > This problem is because of different UID of tree.
>
> > > Hope this solve your issue.
>
> > > Regards
> > > Gagan Deep
>
> >  > On 4 October 2011 14:32, henry joe <[email protected]> wrote:
>
> > > > i have written this code below to open a certain node "selectedXml" yet
> > it
> > > > doesn't open it and it doesn't show the parents. instead, it just shows
> > the
> > > > given node. Anyone knows what i should do?
>
> > > > private function clickedItem():void{
>
> > > >          selectedXml = treeDP.selectedItem;
> > > >             for each (var child:XML in parentXmlCopy.children()){
> > > >                 if
> > (child..model_chain.contains(selectedXml)||child.contains(selectedXml)||chi
> > ld.model_chain..task.contains(selectedXml)){
>
> > > >                     tree.expandChildrenOf(child,false);
> > > >                     len = selectedXml.childIndex();
> > > >                     trace(len);
> > > >                     expandConcernedNode(selectedXml);
>
> > > >                 }
>
> > > >             }
> > > >         }
>
> > > >         private function expandConcernedNode(_xml:XML):void{
>
> > > >             while (_xml.parent() != null) {
> > > >                 _xml = _xml.parent();
> > > >                 tree.expandItem(_xml, true, false);
>
> > > >                 tree.selectedItem = selectedXml;
> > > >             }
> > > >         }
>
> > > > I have searched alot on the internet, still no solution to the problem.
> > I
> > > > am actually calling the clickedItem() function from a list Handler this
> > way
> > > > :
>
> > > > protected function treeDP_changeHandler(event:IndexChangeEvent):void
>
> > > >         {
>
> > if(condRBT.selected||modelRBT.selected||taskRBT.selected||chainRBT.selected
> > )
> > > >                 callLater(clickedItem);
>
> > > > }
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Flex India Community" group.
> > > > To post to this group, send email to [email protected].
> > > > To unsubscribe from this group, send email to
> > > > [email protected].
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/flex_india?hl=en.
>
> > > --
> > > *Thanks*
> > > *Gagan Deep*
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Flex India Community" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected].
> > For more options, visit this group at
> >http://groups.google.com/group/flex_india?hl=en.
>
> --
> *Thanks*
> *Gagan Deep*

-- 
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.

Reply via email to