Grid Flex


    
    
        
            
                            dataField="range"
                sortCompareFunction="sortRanges"/>
        

    
    
        
            import mx.collections.ArrayCollection;
            import mx.rpc.events.ResultEvent;
            [Bindable]
            private var homesForSale:ArrayCollection;
            private function initApp():void {
                this.srv.send();
            }
            private function onResult(evt:ResultEvent):void {
                this.homesForSale = evt.result.data.region;
            }
            private function sortRanges(obj1:Object, obj2:Object):int{
                var value1:Number = obj1.range.range1;
                var value2:Number = obj2.range.range1;
                if(value1 < value2) {
                    return -1;
                }
                else if(value1 > value2){
                    return 1;
                }
                else {
                    return 0;
                }
            }