From the documentation:
SortField () constructor
public function SortField(name:String = null, caseInsensitive:Boolean = false, descending:Boolean = false, numeric:Object = null)
I'm confused on the last part - numeric:Object = null
Here is my function:
private function createXMLDataProvider():XMLListCollection{
var sort:Sort = new Sort();
sort.fields = [new SortField("@sortorder",true,false,true), new SortField("@label")];
var searchTypesCollection:XMLListCollection = new XMLListCollection(getAssociations(_appData.searchTypes, "category", searchType));
searchTypesCollection.sort = sort;
searchTypesCollection.refresh();
return searchTypesCollection;
}
On this line:
sort.fields = [new SortField("@sortorder",true,false,true), new SortField("@label")];
The first SortField is a number but is being compared like it is text, what should I be putting where it says true?
Also from the documentation:
Specifies that if the field being sorted contains numeric (number/int/uint) values, or string representations of numeric values, the comparitor use a numeric comparison. If this property is false , fields with string representations of numbers are sorted using strings comparison, so 100 precedes 99, because "1" is a lower string value than "9". If this property is null , the first data item is introspected to see if it is a number or string and the sort proceeds based on that introspection
The default value is false.