flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mih...@apache.org
Subject [2/3] git commit: [flex-sdk] [refs/heads/develop] - FLEX-34879 Replacing SortField setters with constructor arguments.
Date Sat, 25 Jul 2015 13:50:10 GMT
FLEX-34879
Replacing SortField setters with constructor arguments.


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

Branch: refs/heads/develop
Commit: cd5f9efa5b4d427803db606580caf80f00472fb9
Parents: 462a85b
Author: Mihai Chira <mihaic@apache.org>
Authored: Sat Jul 25 15:41:33 2015 +0200
Committer: Mihai Chira <mihaic@apache.org>
Committed: Sat Jul 25 15:41:33 2015 +0200

----------------------------------------------------------------------
 .../src/mx/controls/AdvancedDataGridBaseEx.as   | 11 +++--------
 .../projects/mx/src/mx/controls/DataGrid.as     | 12 ++----------
 .../SWFs/DataGridApp_halo.mxml                  | 20 +++++++++-----------
 .../DataGrid_SparkSkin/SWFs/DataGridApp.mxml    | 18 ++++++++----------
 4 files changed, 22 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/cd5f9efa/frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGridBaseEx.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGridBaseEx.as b/frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGridBaseEx.as
index 3bdf4bd..b0a1f67 100644
--- a/frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGridBaseEx.as
+++ b/frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGridBaseEx.as
@@ -6133,13 +6133,8 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
         }
 
         column.sortDescending = desc;
-        var field:ISortField = new SortField(columnName);
-        field.sortCompareType = column.sortCompareType;
-        field.descending = desc;
-        
-        if (column.sortCompareFunction != null)
-            field.compareFunction = column.sortCompareFunction;
-		
+        var field:ISortField = new SortField(columnName, false, desc, null, column.sortCompareType,
column.sortCompareFunction);
+
 		fields = collection.sort.fields;
 		if (fields == null)
 			fields = [];
@@ -6892,7 +6887,7 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
      *  @private
      *  Catches any events from the model. Optimized for editing one item.
      *  Creates columns when there are none. Inherited from list.
-     *  @param eventObj
+     *  @param event
      */
     override protected function collectionChangeHandler(event:Event):void
     {

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/cd5f9efa/frameworks/projects/mx/src/mx/controls/DataGrid.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/mx/src/mx/controls/DataGrid.as b/frameworks/projects/mx/src/mx/controls/DataGrid.as
index 341d629..92dca9b 100644
--- a/frameworks/projects/mx/src/mx/controls/DataGrid.as
+++ b/frameworks/projects/mx/src/mx/controls/DataGrid.as
@@ -3969,7 +3969,6 @@ public class DataGrid extends DataGridBase implements IIMESupport
                 {
                     for (var i:int = 0; i < sf.length; i++)
                     {
-
                         if (sf[i].name == c.dataField)
                         {
                             // we're part of the current sort
@@ -3986,7 +3985,7 @@ public class DataGrid extends DataGridBase implements IIMESupport
 
             if (!f)
             {
-                f = new SortField(c.dataField);
+                f = new SortField(c.dataField, false, desc, null, null, c.sortCompareFunction);
                 f.sortCompareType = c.sortCompareType;
             }
 
@@ -4002,14 +4001,7 @@ public class DataGrid extends DataGridBase implements IIMESupport
 
             // if you have a labelFunction you must supply a sortCompareFunction
             f.name = c.dataField;
-            if (c.sortCompareFunction != null)
-            {
-                f.compareFunction = c.sortCompareFunction;
-            }
-            else
-            {
-                f.compareFunction = null;
-            }
+            f.compareFunction = c.sortCompareFunction;
             f.descending = desc;
             s.fields = [f];
         }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/cd5f9efa/mustella/tests/components/DataGrid/DataGrid_HaloSkin/SWFs/DataGridApp_halo.mxml
----------------------------------------------------------------------
diff --git a/mustella/tests/components/DataGrid/DataGrid_HaloSkin/SWFs/DataGridApp_halo.mxml
b/mustella/tests/components/DataGrid/DataGrid_HaloSkin/SWFs/DataGridApp_halo.mxml
index fd56d26..a93ad2f 100644
--- a/mustella/tests/components/DataGrid/DataGrid_HaloSkin/SWFs/DataGridApp_halo.mxml
+++ b/mustella/tests/components/DataGrid/DataGrid_HaloSkin/SWFs/DataGridApp_halo.mxml
@@ -749,20 +749,18 @@
 		var dg:DataGrid = DataGrid(event.target);
 		var dgc:DataGridColumn = dg.columns[event.columnIndex] as DataGridColumn;
 		var s:Sort = new Sort();
-		var sf:SortField = new SortField(dgc.dataField);
+
+        var numeric:Object = null;
+        if(dgc.headerText == "numeric")
+            numeric = true;
+        else if(dgc.headerText == "alpha")
+            numeric = false;
+
+		var sf:SortField = new SortField(dgc.dataField, false, !dgc.sortDescending, numeric);
 		var dp:ICollectionView = dg.dataProvider as ICollectionView;
 
 		event.preventDefault();
-		
-		sf.descending = !dgc.sortDescending;
-
-		if(dgc.headerText == "numeric")
-			sf.numeric = true;
-		else if(dgc.headerText == "alpha")
-			sf.numeric = false;
-		else
-			sf.numeric = null;
-			
+
 		dgc.sortDescending = sf.descending;
 		s.fields = [ sf ];
 		

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/cd5f9efa/mustella/tests/components/DataGrid/DataGrid_SparkSkin/SWFs/DataGridApp.mxml
----------------------------------------------------------------------
diff --git a/mustella/tests/components/DataGrid/DataGrid_SparkSkin/SWFs/DataGridApp.mxml b/mustella/tests/components/DataGrid/DataGrid_SparkSkin/SWFs/DataGridApp.mxml
index 007b3df..15ac9e9 100644
--- a/mustella/tests/components/DataGrid/DataGrid_SparkSkin/SWFs/DataGridApp.mxml
+++ b/mustella/tests/components/DataGrid/DataGrid_SparkSkin/SWFs/DataGridApp.mxml
@@ -763,20 +763,18 @@
 		var dg:DataGrid = DataGrid(event.target);
 		var dgc:DataGridColumn = dg.columns[event.columnIndex] as DataGridColumn;
 		var s:Sort = new Sort();
-		var sf:SortField = new SortField(dgc.dataField);
+
+        var numeric:Object = null;
+        if(dgc.headerText == "numeric")
+            numeric = true;
+        else if(dgc.headerText == "alpha")
+            numeric = false;
+
+		var sf:SortField = new SortField(dgc.dataField, false, !dgc.sortDescending, numeric);
 		var dp:ICollectionView = dg.dataProvider as ICollectionView;
 
 		event.preventDefault();
 		
-		sf.descending = !dgc.sortDescending;
-
-		if(dgc.headerText == "numeric")
-			sf.numeric = true;
-		else if(dgc.headerText == "alpha")
-			sf.numeric = false;
-		else
-			sf.numeric = null;
-			
 		dgc.sortDescending = sf.descending;
 		s.fields = [ sf ];
 		


Mime
View raw message