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 ?
you can directly set requestedMinRowCount
to 3 in the VerticalLayout
<s:List>
<s:layout>
<s:VerticalLayout requestedMinRowCount="3"/>
</s:layout>
</s:List>
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With