mouseDown events bubble, so if you listen for mouseDown on the Tree you will see every mouseDown on all renderers, scrollbars, dead space, etc.
The event.target of the mouseDown event will point to the renderer or a child of the renderer. Use contains() or owns() or walk the parent chain to see which itemRenderer has been hit, if any. If you subclass, you can use mouseEventToItemRenderer. Once you have the itemRenderer, examine its .data to see if it is a branch or not. ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of xmwang1982 Sent: Tuesday, February 26, 2008 9:15 PM To: [email protected] Subject: [flexcoders] Re: How to get all itemrenderer instances of a tree? thanks. I need more help from you guys. Let me explain a little more about my question. The requirement is, all mouseDown events on leaf nodes have to be processed, and the event on branch nodes are not needed to be processed. So I wanted to add event listeners for all leaf nodes in the "creationComplete" event of the tree's parent control. Thanks in advance. --- In [email protected] <mailto:flexcoders%40yahoogroups.com> , "Alex Harui" <[EMAIL PROTECTED]> wrote: > > Renderers are "virtual" Only as many instances exist as you can see on > screen. They are recycled and used to display other dataprovider items > as you scroll or expand/contract. That's why there is no such method. > You can get to the on-screen renderers via indexToItemRenderer(), but > you'll be better off working from within the renderers do handle the > mouse. > > > > ________________________________ > > From: [email protected] <mailto:flexcoders%40yahoogroups.com> [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> ] On > Behalf Of xmwang1982 > Sent: Tuesday, February 26, 2008 6:24 AM > To: [email protected] <mailto:flexcoders%40yahoogroups.com> > Subject: [flexcoders] How to get all itemrenderer instances of a tree? > > > > Hi experts, > > I want to listen to the MouseDown event of some of the tree nodes. So > maybe I need to get their itemrenderer instances then add event > listeners to them. However, I have no idea to get a list of item > renderers... seems no such a method exists. > > Could you please give some hints? > > Thanks a lot. >

