". i did not encode the result into xml format" eh? I don't understand what
you mean by that.  You are using e4x xml here.

 

"parent" is a property pointing to the parent component in the document
model.  I do not think you want that.  "parent()", applied to an XML node
return an XML node,

 

Tracy Spratt,

Lariat Services, development services available

  _____  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of eric v
Sent: Sunday, January 10, 2010 5:14 AM
To: flexcoders@yahoogroups.com
Subject: [SPAM] [flexcoders] How to get all tree node parents upon select

 

  


maybe this will give you some insight. i did not encode the result into xml
format..

 

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute">

            <mx:Script>

                        <![CDATA[

                                    [Bindable] var xml:XML = <products
label="products">

 
<item label="item1">

 


            <sku label="sku">1001</sku><quantity
label="quantity">100</quantity>

 
</item>

 
<item label="item2">

 
<sku label="sku">1002</sku><quantity label="quantity">100</quantity>

 
</item>

 
</products>

                        

                                    private function onClick(event):void {

                                                var parent =
event.currentTarget.selectedItem.parent();

                                    

 
//mx.controls.Alert.show(event.currentTarget.selectedItem.toString());

                                                do {

 
mx.controls.Alert.show(pare...@label.tostring());

                                                            parent =
parent.parent();

                                                } while (parent);

                                    }

                        ]]>

            </mx:Script>

            

            <mx:Tree width="100%" click="onClick(event)"
dataProvider="{xml}" labelField="@label" showRoot="false" >

                        

            </mx:Tree>

</mx:Application>

 

 

DOES ANYONE KNOW WHAT KIND OF VARIABLE parent  WOULD BE.. INSTANTIATED AS?

 



Reply via email to