tags:

views:

149

answers:

1

Hi I'm using flex 4.1 to write an application.

i read in the documents that has the rowCount property to set how many items to display. the does not have that property.

how can I limit the list to display 3 items ?

+1  A: 

In Flex 4 this is driven by the skin rather than the component itself. You can create a custom List skin and in the VerticalLayout of the DataGroup, set the requestedRowCount to 3, then set the skin for your List to be your new custom skin. To get started, just copy the default ListSkin into your custom skin file and make your changes. Here's the relevant section from the default ListSkin file:

   <s:DataGroup id="dataGroup" itemRenderer="spark.skins.spark.DefaultItemRenderer">
        <s:layout>
            <!--- The default layout is vertical and measures at least for 5 rows.  
            When switching to a different layout, HorizontalLayout for example,
            make sure to adjust the minWidth, minHeihgt sizes of the skin -->
            <s:VerticalLayout gap="0" horizontalAlign="contentJustify" requestedMinRowCount="5" />
        </s:layout>
    </s:DataGroup>

Just remove requestedMinRowCount and replace it with requestedRowCount="3" Hope that helps.

Wade Mueller
it helped a lot! it totally resolved my issue!
ufk