Right, but that click does *not* cascade through parent menus--this is the problem. If I have a hierarchy, I can only use this trick on the top-most menu unless I add handlers to all menus in the chain, and I'm not sure how to find these a priori...
-Maciek -----Original Message----- From: Tracy Spratt <tspr...@lariatinc.com> Reply-to: flexcoders@yahoogroups.com To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] select non-top level items in a hierarchical menu Date: Tue, 7 Apr 2009 00:33:39 -0400 The Menu will dispatch a plain “click” event for the parent nodes. Since menu options also dispatch “click”, you need to check for tht in the handler. Tracy Spratt, Lariat Services, development services available ________________________________________________________________________ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Maciek Sakrejda Sent: Monday, April 06, 2009 6:07 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] select non-top level items in a hierarchical menu So it looks like I can fake this by tracking a stack of open menus and dynamically adding / removing MOUSE_DOWN listeners to the last menu opened / closed. This seems... ahem... less than ideal. Anyone have a better suggestion? -Maciek -----Original Message----- From: Maciek Sakrejda <msakre...@truviso.com> Reply-to: flexcoders@yahoogroups.com To: flexcoders <flexcoders@yahoogroups.com> Subject: [flexcoders] select non-top level items in a hierarchical menu Date: Mon, 06 Apr 2009 13:07:37 -0700 I need the ability to select non-leaf items in a hierarchical menu--is this doable? Basically, suppose I have a dataProvider like this: [ { label: 'a' }, { label: 'b', children: [ { label: '1' }, { label: '2' } ] } ] I want to be able to select a, b, 1, or 2. I can do exactly what I want with a Tree, but I was hoping for something more compact. It seems that selecting a node that has children does not dispatch an ITEM_CLICK event: it just automatically opens the submenu. I'd like to open/close the submenu on rollOver/rollOut, and dispatch a normal ITEM_CLICK for that item on a click. -Maciek