08 December 2008 ~ Comments

Release: Flex AutoSizingList Component

Share

I'd been desperately scouring the 'webs over the last few days trying to find a Flex List component that would automatically resize to fit its data provider's contents when using variable row height item renderers. The closest I came to finding such a work was a blog post citing some work done by the people at Workday on the AdvancedDataGrid class. The author of the first post mentioned that he would release his component once he got client approval, which seems to never have happened. I decided to tackle the problem myself and, after very little modifying of the Workday crew's code, came up with just what I needed. Hit up the component's page to see an example and download the source code, which I've released under the MIT License. I hope this helps someone else as much as it helped me.

Tags: ,
  • aw
    great work man!
  • Thanks aw. I hope you get some use out of it.
  • @Karen I'm glad you got it working.
  • Karen
    Bryan,

    I figured it out. You need to set the resizeToContent="true" for the viewstack otherwise the height was appearing to be a height of 2.

    Thanks again for posting this component.

    cheers,
    karen
  • @Karen I'm not exactly sure what your issue is. I'd probably need to see some source code to be of more help. Post some code if you'd like and I'll take a look at it.
  • Karen
    I'm still coming up to speed on Flex, however your component helped with some issues I was having. It doesn't work when I put it in a viewstack. Can you explain to me why or what I might need to do to make it work.

    thanks
  • @radley Actually, that's not what I was aiming for at all. I want the length of the list component to change, as you can see in the example. Your solution leaves the list at a fixed height. Nice try, though.
  • radley
    you could have just used:

    variableRowHeight="true"

    rowCount="{list.dataProvider.length}"
  • @Vikash I haven't spent much time with the AdvancedDataGrid component. You may want to ask the guys at Workday, as they may have encountered the same issue you're trying to tackle. Good luck.
  • Vikash Sharma
    Hi

    I am creating advanced data grid dynamically. Columns are added at runtime.
    1. How can i resize the width of advanced datagrid ?
    2. Actually, Last Column width always become larger.

    Plz advise.

    Thx
    Vikash
blog comments powered by Disqus