flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mih...@apache.org
Subject [12/12] git commit: [flex-sdk] [refs/heads/develop] - FLEX-34884 The new function added to ISortField impacted GridSortField and the spark SortField as well, so I added these functions there too. Currently they are not being called, so it's safe. But soo
Date Mon, 08 Jun 2015 18:02:39 GMT
FLEX-34884
The new function added to ISortField impacted GridSortField and the spark SortField as well,
so I added these functions there too. Currently they are not being called, so it's safe. But
soon they will, once all the changes from the mx side will be made onto the spark side of
sorting.


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/4ed0ee64
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/4ed0ee64
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/4ed0ee64

Branch: refs/heads/develop
Commit: 4ed0ee64c9b0797e0e3bef4730337901c968cb46
Parents: 4bdf75f
Author: Mihai Chira <mihaic@apache.org>
Authored: Mon Jun 8 19:38:56 2015 +0200
Committer: Mihai Chira <mihaic@apache.org>
Committed: Mon Jun 8 19:38:56 2015 +0200

----------------------------------------------------------------------
 .../spark/src/spark/collections/SortField.as    | 26 ++++++++++++++++++++
 .../components/gridClasses/GridSortField.as     | 10 ++++++--
 2 files changed, 34 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/4ed0ee64/frameworks/projects/spark/src/spark/collections/SortField.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/collections/SortField.as b/frameworks/projects/spark/src/spark/collections/SortField.as
index 44e8fec..00ba899 100644
--- a/frameworks/projects/spark/src/spark/collections/SortField.as
+++ b/frameworks/projects/spark/src/spark/collections/SortField.as
@@ -755,6 +755,32 @@ public class SortField extends AdvancedStyleClient implements ISortField
         return false;
     }
 
+    public function objectHasSortField(object:Object):Boolean
+    {
+        return getSortFieldValue(object) !== undefined;
+    }
+
+
+    //--------------------------------------------------------------------------
+    //
+    // Protected Functions
+    //
+    //--------------------------------------------------------------------------
+
+    protected function getSortFieldValue(obj:Object):*
+    {
+        var result:Object = undefined;
+
+        try
+        {
+            result = obj[_name];
+        }
+        catch(error:Error)
+        {
+        }
+
+        return result;
+    }
 
     //--------------------------------------------------------------------------
     //

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/4ed0ee64/frameworks/projects/spark/src/spark/components/gridClasses/GridSortField.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/components/gridClasses/GridSortField.as b/frameworks/projects/spark/src/spark/components/gridClasses/GridSortField.as
index 3fe6572..1890129 100644
--- a/frameworks/projects/spark/src/spark/components/gridClasses/GridSortField.as
+++ b/frameworks/projects/spark/src/spark/components/gridClasses/GridSortField.as
@@ -53,8 +53,14 @@ public class GridSortField extends SortField
     {
         super(name, descending, numeric);
     }
-    
-    
+
+    override public function objectHasSortField(object:Object):Boolean
+    {
+        if(name && name.indexOf(".") != -1)
+            return object && object.hasOwnProperty(name.split(".")[0]);
+        else
+            return super.objectHasSortField(object);
+    }
     //--------------------------------------------------------------------------
     //
     //  Properties


Mime
View raw message