Thank you!

 

Worked like a charm.

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Tracy Spratt
Sent: Tuesday, February 06, 2007 1:57 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] detect XML node on click in Tree

 

selectedItem gives you a reference to the node.

 

Probably what you are seeing is because the event is just an Object containing
the xml, so some propeties are not visible.  Cast/convert the result into an xml
object:

var oItem:Object = event.currentTarget.selectedItem;

var xmlItem:XML = XML(oItem)

 

xmlItem will be the node.

 

Tracy

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of TCash21
Sent: Tuesday, February 06, 2007 12:55 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] detect XML node on click in Tree

 

I have a Tree that's populated based on e4x XML, which is generated by
PHP from querying the backend. I have a structure like this:

<projects>
<project>
<experiments>
<experiment>
</experiment>
</experiments>
</project>
</projects>

I'd like to be able to double click on an item in the Tree and change
to the necessary viewStack page, which will allow the user to edit the
info. The viewStack page will depend on whether the user clicked on a
project or experiment. 

So far I've tried using onChange(event),
event.currentTarget.selectedItem, which only gives me certain
attributes. I just want to be able to somehow know which XML node
<experiment> or <project> was clicked so I can open the right window.

I've been reading about ItemRenderers, will I need to use one?
I'm familiar with eventListeners but I'm still unsure about how to get
the appropriate XML node based on a click.

Thanks for any help.

 





THE INFORMATION TRANSMITTED IN THIS ELECTRONIC COMMUNICATION IS INTENDED ONLY 
FOR THE PERSON OR ENTITY TO WHOM IT IS ADDRESSED AND MAY CONTAIN CONFIDENTIAL 
AND/OR PRIVILEGED MATERIAL.  ANY REVIEW, RETRANSMISSION, DISSEMINATION OR OTHER 
USE OF OR TAKING OF ANY ACTION IN RELIANCE UPON, THIS INFORMATION BY PERSONS OR 
ENTITIES OTHER THAN THE INTENDED RECIPIENT IS PROHIBITED.  IF YOU RECEIVED THIS 
INFORMATION IN ERROR, PLEASE CONTACT THE SENDER AND THE PRIVACY OFFICER, AND 
PROPERLY DISPOSE OF THIS INFORMATION.


Reply via email to