Category Archives: ArrayCollection

Creating an auto-scrolling DataGrid control in Flex

In a previous example, “Auto-scrolling a TextArea control in Flex”, we saw how you can auto-scroll a Flex TextArea control when new content is added by setting the verticalScrollPosition property to the value of the maxVerticalScrollPosition property.

The following example shows how you can auto-scroll a Flex DataGrid control using the ArrayCollection object’s collectionChange event, and the verticalScrollPosition and maxVerticalScrollPosition properties.

Continue reading Creating an auto-scrolling DataGrid control in Flex

Using a CheckBox control as a list item renderer in Flex

The following example will show you how you can use a CheckBox control as a custom item renderer in a List control in Flex.
I haven’t done a lot of testing yet, so if you have any tips/suggestions/improvements, please, share them in the comments.

Full code after the jump.

Continue reading Using a CheckBox control as a list item renderer in Flex

Sorting an ArrayCollection using the SortField and Sort classes

Sometimes in life you just need data to be sorted. Whether its a case insensitive sort (for names) or a numeric sort (for, uh, numbers), you just want things sorted in a particular order.

This example demonstrates how you can take a bunch of random numbers in an ArrayCollection and sort them numerically in ascending order.

Continue reading Sorting an ArrayCollection using the SortField and Sort classes