3 Replies Latest reply on Mar 31, 2010 11:25 AM by matn1

    Question: Why would I get an undefined property error for this DataGrid property



        I am trying to use Flex 4 with existing Flex 3 Code and I keep getting the following Compilation error for my DataGrid on calling my

        sort function. Was working in Flex 3


      1120:Access of undefined property caselessSortForField("username")


      In same  file I have the following function


         public function  caselessSortForField(field:String):Function
                       return function(obj1:Object, obj2:Object):int
                           return ObjectUtil.stringCompare(obj1[field], obj2[field], true);


      In my Datagrid I call

        <mx:DataGridColumn  headerText="User Name" dataField="username"  sortCompareFunction="caselessSortForField('username')"/> 


      Any ideas