You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by mi...@apache.org on 2015/06/08 20:02:39 UTC

[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

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 <mi...@apache.org>
Authored: Mon Jun 8 19:38:56 2015 +0200
Committer: Mihai Chira <mi...@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