Hi Ben,

  Thanks for your reply..

  I added a custom sortable function and it looks like it fails when
it finds any null values !!

  The function i wrote is:

[CODE]

private function comparGridItem(itema:Node,itemb:Node):int{
                        var filteredField:String = selectedColumn;
                                trace("Selected Field ="+filteredField);
                                var itemValueA:String = 
itema.propertyHolderMap[filteredField];
                                trace(" Val1 ="+itemValueA);
                                var itemValueB:String = 
itemb.propertyHolderMap[filteredField];
                                trace(" Val2 ="+itemValueB);
                                if(itemValueA!=null && itemValueB !=null){
                                        if(itemValueA > itemValueB){
                                                return -1;
                                        }else if(itemValueA < itemValueB){
                                                return 1;
                                        }else{
                                                return 0;
                                        }
                                }
                                else{
                                        if(itemValueA==null) return 1;
                                        else return -1;
                                }
                        }

[/CODE]

 Does this mean if any of the Columns have null values it will throw
this Exception ??

Here is my output from the trace log..

[EXCEP]
Selected Field =namedisplay
 Val1 =Records Series A
 Val2 =Records Series B
Selected Field =namedisplay
 Val1 =Test Data
 Val2 =Records Series B

Error: Find criteria must contain at least one sort field value.
        at mx.collections::Sort/findItem()
        at mx.collections::ListCollectionView/getItemIndex()
        at ListCollectionViewCursor/collectionEventHandler()
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at mx.collections::ListCollectionView/dispatchEvent()
        at mx.collections::ListCollectionView/internalRefresh()
        at mx.collections::ListCollectionView/refresh()
        at mx.controls::DataGrid/sortByColumn()
        at mx.controls::DataGrid/headerReleaseHandler()
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at mx.core::UIComponent/dispatchEvent()
        at mx.controls::DataGrid/mouseUpHandler()
Error: Find criteria must contain at least one sort field value.
        at mx.collections::Sort/findItem()
        at mx.collections::ListCollectionView/getItemIndex()
        at ListCollectionViewCursor/collectionEventHandler()
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at mx.collections::ListCollectionView/dispatchEvent()
        at mx.collections::ListCollectionView/internalRefresh()
        at mx.collections::ListCollectionView/refresh()
        at mx.controls::DataGrid/sortByColumn()
        at mx.controls::DataGrid/headerReleaseHandler()
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at mx.core::UIComponent/dispatchEvent()
        at mx.controls::DataGrid/mouseUpHandler()
[/EXCEP]

Thanks
Mars

Reply via email to