•  
  •  
Dynamically resize nested Flex List with variableRowHeight

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

About Rob Rusher

In his role as Principal Consultant for On3, Rob leads an software development practice to help his clients build rich Internet applications for the desktop, browser, and mobile devices, and to rapidly increase their knowledge and skills to better support their organization's goals. Rob is an Adobe Certified Expert, Community Professional, and Certified Instructor. He has taught and mentored the technical teams at HP, Overstock, Paychex, SAS, the FedEx, and other Government and Fortune 100 organizations. Rob has co-authored four best-selling books on building secure, cutting-edge and rapidly developed applications using Adobe AIR, ColdFusion and Flex. He is very active in organizing and speaking at RIA, Adobe LiveCycle, mobile conferences, and user groups. In addition to growing his software consulting practice, On3, Rob has been building expertise in rich client application development on a wider variety of devices and platforms that extend the applications to change the way we all create and live.