2 Replies Latest reply on Nov 12, 2009 9:06 PM by Shongrunden

    Closing up empty space with Spark Lists

    Handycam Level 1

      I have a series of Spark List components I made.  I'd like to BOTH hide empty lines so there are no "holes" AND set the height of each list to only be as high as needed to display its contents.  They are currently all the same size no matter how many lines they hold




      I have attached the component I am using.  It is instanced like this:



      <comp:ScheduleItem id="week" timeLabel="A Week Before" timeData="{scheduleLC}" filterString="1w" width="100%"/>
        • 1. Re: Closing up empty space with Spark Lists
          Peter deHaan Level 4



          I'm not sure why your data provider would have so many empty items, but you could try filtering the data provider (use the ArrayCollection filterFunction property, for example) to not display items with a length of 0 characters.


          As for changing the default height of the List containers, you may need to reskin the Spark List control and set the minHeight to a smaller value. I believe the current defalt minimum width/height for a Spark List control is about 112px, which is enough to display 5 items using the default item renderer. You can find the default Spark skins at %Flex SDK%\frameworks\projects\spark\src\spark\skins\spark\ (the default List skin would be in the ListSkin.mxml file).


          Hope that helps,


          • 2. Re: Closing up empty space with Spark Lists
            Shongrunden Adobe Employee

            Just thought of another approach: You could set the height of the renderer to 0 if the data is null.  This would still leave the gaps from the VerticalLayout, so you could set the gap to 0 and account for it accordingly inside your renderer.