Hey Alex. Yeah, I tried Peter Ent's Stack Component a while ago but the nested list renderers was giving me a lot of issues so I jumped ship. I did find another example on Peter's site that seems close to what I'm looking for (http://weblogs.macromedia.com/pent/archives/2006/04/a_list_itemrend.cfm <http://weblogs.macromedia.com/pent/archives/2006/04/a_list_itemrend.cfm\ > )
I put together his code with the menu model I am working with. I am only focusing on a menu with one level deep to simplify things for now. Here is the working example (view source enabled) : http://www.useflashmore.com/flex-as3-scrollable-accordion-menu/scrollabl\ e-list-custom-item-renderer/main.html <http://www.useflashmore.com/flex-as3-scrollable-accordion-menu/scrollab\ le-list-custom-item-renderer/main.html> Peter's example was great but there are still a few hurdles to get over. 1. What is the appropriate way to resize the parent list from within the child itemRenderer. I've tried a few different approaches using events to listen for the itemRenderer resize. Ideally I'd just be able to grab the height or explicitHeight property of the parent list after the itemRenderer has been resized and then to a Resize. Right now I'm resizing the parent using "SetProperty" inside of the renderer just to show the effect I'm going for. [code]<mx:SetProperty target="{parentList}" name="height" value="{parentList.height + getChildListHeight() + 10}"/>[/code] 2. The other caveat is that I need the parent to only size to the height of the stage so I will need to calculate the available height and send that to the child Item Renderer. What is the best way to go about that? Thanks. --- In [email protected], "Alex Harui" <[EMAIL PROTECTED]> wrote: > > I was thinking of Peter Ent's Stack Component. It is an accordion with > more than one visible panel. > > > > However, the notion of multiple levels of nesting makes me think you > should try Lists with in Lists with custom renderers that expand to have > a child list. Again, selection model is key. The Flex 3 List is more > tolerant of effects too. > > > > ________________________________ > > From: [email protected] > [mailto:[EMAIL PROTECTED] On Behalf Of Justin Winter > Sent: Wednesday, November 21, 2007 1:02 PM > To: [email protected] > Subject: [flexcomponents] "The Joy of... Flex" - Scrollable Accordion > Navigation (re: Scroll Tree Branch) > > > > Thanks Alex. > > I did searches on every combination of expand/collapse, accordion, tree, > etc I could think of on flexcoders and did come across a few interesting > ideas. Most notably is a list of custom itemRenderers that > expand/collapse based on a open/close property set in the data override. > > > http://tech.groups.yahoo.com/group/flexcoders/message/59924 > <http://tech.groups.yahoo.com/group/flexcoders/message/59924> > > Unfortunately I didn't find anything that looked like what I need. > > I've gone back and looked at the accordion container several times and > it's definitely closer in some ways to what I need. However, if you look > at the following example you can see some of the issues I still have. > > http://www.useflashmore.com/flex-as3-scrollable-accordion-! > menu/accordion-component-test/ScrollableAccordionTest.html > <http://www.useflashmore.com/flex-as3-scrollable-accordion-menu/accordio > n-component-test/ScrollableAccordionTest.html> > > and the source: > > http://www.useflashmore.com/flex-as3-scrollable-accordion-menu/accordion > -component-test/srcview/index.html > <http://www.useflashmore.com/flex-as3-scrollable-accordion-menu/accordio > n-component-test/srcview/index.html> > > Major Requirements (likely requiring core overrides implementing custom > logic) > ---------------------------- > > 1. All containers should be collapsed when the control is first opened, > or at least the first time the control is shown. > 2. Cascading tweens in the use case when the parent node's sibling is > clicked, the current open branch should tween closed first, then the > clicked node branch should open (see the AS2 example when clicking on > any parent node when a child node is already open) > 3. Container resizing. As child branches, expand/collapse, the! root > container should resize at the same time as the branches! resize > (similar to a tree). The Accordion control cascades the resize, it > doesn't happen in parallel as I need. > 4. Recursive levels. A Branch with with 3 or more levels of nodes > presents a variety of resize tween issues that seems difficult to > overcome with the accordion container > > Minor Annoyances (probably could be easily fixed with an few more hours > of tweaking) > -------------------------- > 1. What the heck, and more importantly, where the heck is the style > setting for the padding/space on an accordion menu header that doesn't > have any children? > 2. Child containers are not sized to the content > 3. drop shadow on the parent siblings to act as a visual cue of which > branch is currently active. (see the AS2 example when the sub menu is > opened) > > At this point I'm thinking it probably makes sense to just rebuild the > component by extending the ScrollControlBase class or UIComponent. It > just seems that massaging any of the above components to look! /behave > the way I want would likely take as long if not longer than developing > something from scratch or rather from my AS2 version. If I'm on crazy > pills, please let me know. > > In case anyone is interested, I'm blogging my process. > > http://www.useflashmore.com <http://www.useflashmore.com> >
