Sort Array Collection in Actrionscript/flex

public function sortCollection(arrayCollection : ArrayCollection) : ArrayCollection
{
//Create the sort field
var dataSortField:SortField = new SortField();

//name of the field of the object on which you wish to sort the Collection
dataSortField.name = “revenue”;
dataSortField.caseInsensitive = true;

/*
If you wish to perform numeric sort then set:
dataSortField.numeric = true;
*/

//create the sort object
var dataSort:Sort = new Sort();
dataSort.fields = [dataSortField];

arrayCollection.sort = dataSort;
//refresh the collection to sort
arrayCollection.refresh();

return arrayCollection;
}

About ashokabhat

I am a C,C ,JAVA,Adobe Flex,.NET Programmer Currently working as a Software Developer
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s