Flex List Items With Dynamic Heights

I was playing around with custom building custom item renderers today in flex and ran into a rather annoying problem: when using multiple item renderers in a single list or datagrid component, all of the items inherit the height and width properties of the first item that gets added to the list/datagrid. In my case, I wanted the first item added to be only 25px in height, and have subsequent items be of varying heights. I searched far and wide across the “google-verse” (insert copyright logo here) and found a bunch of solutions that discussed having to create your own custom list component to achieve the desired result, then I came across the holy grail, a property of the list component that would solve all of my problems, the answer… “variableRowHeight=’true’”. Once I set that on my list components all of the list items were allowed to have their own unique height. WOOH!


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button


2 Responses to “Flex List Items With Dynamic Heights”

  1. At first this sounds like a good solution…until you realize that the list’s total height is still the height of the first row multiplied by the rowCount. I need to create a list that will correctly size itself based on the measuredHeight of the rows.

  2. Giil TAWS Says:

    Yes !
    Thank you !
    I feel happy now !

Leave a Reply