Tag Archive for 'sortfield'

05
Aug

Displaying all the properties of a component instance in Flex

The following example shows you how you can display all the getters/setters and their current values for a Flex TextArea control by using the describeType() method, some E4X filtering, and an XMLListCollection.

Full code after the jump.

Continue reading ‘Displaying all the properties of a component instance in Flex’

09
Apr

Creating a custom sort on a DataGrid control in Flex

The following example shows how you can create a custom sort on a Flex DataGrid control by using the SortField class and creating a custom compare function.

Full code after the jump.

Continue reading ‘Creating a custom sort on a DataGrid control in Flex’

28
Feb

Displaying the sort arrow in a Flex DataGrid control without having to click a column

I’ve seen this question come up a few times recently in various forums/lists and even in my blog comments (see “Changing the default sort arrow skin on a Flex DataGrid control”).

The following example shows how you can display the sort arrow in a DataGrid control in Flex without having the user click on a column header in the DataGrid control.

Full code after the jump.

Continue reading ‘Displaying the sort arrow in a Flex DataGrid control without having to click a column’

21
Feb

Creating a custom label function on a Flex PopUpMenuButton control

The following example shows how you can use an XML data provider on a PopUpMenuButton in Flex and create a custom label function using the labelFunction property.

Full code after the jump.

Continue reading ‘Creating a custom label function on a Flex PopUpMenuButton control’

04
Dec

Sorting XML documents using an XMLListCollection

The following example shows how you can sort an XML document by converting it into an XMLListCollection and applying a sort. You can also easily reverse the current sort by calling the SortField object’s reverse() method and refreshing the XMLListCollection object.

Full code after the jump.

Continue reading ‘Sorting XML documents using an XMLListCollection’

22
Aug

Sorting and filtering data in an XMLListCollection

The following code is a brief example of sorting a Flex XMLListCollection using the Sort and SortField classes, and the XMLListCollection.sort property. We also look at filtering the XMLCollection using a custom filter function.

Full code after the jump.

Continue reading ‘Sorting and filtering data in an XMLListCollection’

15
Aug

Sorting an XMLListCollection using the mx:Sort and mx:SortField MXML tags

I actually searched around and couldn’t find any other examples of this, but here is a quick example of using the <mx:Sort /> and <mx:SortField /> MXML tags in Flex to sort an XMLListCollection.

Full code after the jump.

Continue reading ‘Sorting an XMLListCollection using the mx:Sort and mx:SortField MXML tags’

05
Aug

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.

Full code after the jump.

Continue reading ‘Sorting an ArrayCollection using the SortField and Sort classes’