Dynamically resize nested Flex List with variableRowHeight

 

Another quick post…

I was stuck recently with a Flex component that had a List with an itemRenderer. The itemRenderer contained another List with an itemRenderer. Now the problem with this is that the data had unique counts and the lists had variable row heights (variableRowHeight = true). The result was that containers would not dynamically resize enough to display the whole List. In other words, the List was clipped and vertical scroll bars were displayed.

After trying several ways to get it to resize correctly and failing miserably, I extended the List component. As I was doing this, I found another post about an AutoSizingAdvancedDataGrid by the guys at WorkDay in which they had similar issues with the AdvancedDataGrid. Since the AdvancedDataGrid is similar to the List, I only had to make a couple of changes to get it working with the List component.

Once I get approval from my client, I’ll post the AutoSizingList. But until then… see the WorkDay post and their example. Thanks for the post khurram.

Finally able to post the code:

Get Adobe Flash player

 

2 Responses to “Dynamically resize nested Flex List with variableRowHeight”

  1. Hi,

    I am facing a similar problem with the list component. My list has an itemrenderer which expands on click. Everytime I click on an item, another random item also gets activated and expands and the scroll also goes berserk.
    If you were able to fix this issue, please let me know.

    Thanks,
    Jai

     
    • Jai
  2. I ended up creating my own auto sizing list component, which I based off the Workday crew’s work on the AdvancedDataGrid. Check it out at http://www.bryanbartow.com/code/AutoSizingList

     

Leave a Comment

Rob Rusher :.: Building Engaging Experiences for the Browser, Desktop, Mobile and TV