Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flex 4.1: <mx:List> had rowCount properly for the limit the displayed items. <s:List> doesn't

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 ?

like image 543
ufk Avatar asked Dec 08 '22 02:12

ufk


2 Answers

you can directly set requestedMinRowCount to 3 in the VerticalLayout

<s:List>
    <s:layout>
        <s:VerticalLayout requestedMinRowCount="3"/>
    </s:layout>
</s:List>
like image 154
ktutnik Avatar answered Dec 09 '22 15:12

ktutnik


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.

like image 37
Wade Mueller Avatar answered Dec 09 '22 15:12

Wade Mueller