From the category archives:

ObjectUtil

The following example shows how you can get information about a class/object by using the static ObjectUtil.getClassInfo() method.

Full code after the jump.

[click to continue…]

{ 0 comments }

The following example shows how you can perform numeric sorts, case sensitive sorts, or case insensitive sorts in the Flex DataGrid control by setting a custom sort compare function on the DataGridColumn using the sortCompareFunction property, the static ObjectUtil.numericCompare() method, and the static ObjectUtil.stringCompare() method.

Full code after the jump.

[click to continue…]

{ 0 comments }

The following example shows how you can debug your Flex applications using the describeType() method (in the flash.utils package), as well as the static ObjectUtil.toString() method to display information about objects in Flex.

Full code after the jump.

[click to continue…]

{ 0 comments }

The following example shows how you can use the static UIDUtil.getUID() method to generate and retreive a unique identifier for an Object. The first time you click the Display UID button, an Alert control displays the generated UID and a string representation of the Object (yay ObjectUtil.toString()!). The second time you click the Display UID button, you’ll notice that a new parameter is added to the Object, mx_internal_uid.

Full code after the jump.

[click to continue…]

{ 0 comments }

Sorting date columns in a DataGrid

by Peter deHaan on August 12, 2007

in DataGrid,ObjectUtil

Here’s an example of sorting a column of dates in a Flex DataGrid. The dates start out as Strings (such as “04/14/1980″) so you create a custom sortCompareFunction on that DataGrid column which converts the strings to dates so Flex will sort the dates in sequential order (as oppsed to string order). Hope that helps somebody out there.

I also created a little tooltip on the date column which shows the dates in a somewhat more readable form (“April 14 1980″) using the DataGridColumn object’s showDataTips and dataTipFunction properties.

Full code after the jump.

[click to continue…]

{ 33 comments }