You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jm...@apache.org on 2013/05/14 03:47:40 UTC

[2/3] git commit: [flex-sdk] [refs/heads/develop] - Fixed RTE issue when change columns at run time. If you changed from a grid with a larger number of columns to one with a smaller number the headerInfo was being cached. This could cause an RTE.

Fixed RTE issue when change columns at run time. If you changed from a grid with a larger number of columns to one with a smaller number the headerInfo was being cached. This could cause an RTE.


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

Branch: refs/heads/develop
Commit: 0a5f1fbc4880382a5d257c35723019a8d4f9d92a
Parents: 975e4c2
Author: Justin Mclean <jm...@apache.org>
Authored: Tue May 14 11:44:40 2013 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Tue May 14 11:44:40 2013 +1000

----------------------------------------------------------------------
 .../src/mx/controls/AdvancedDataGrid.as            |   30 ++++++++------
 1 files changed, 17 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/0a5f1fbc/frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGrid.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGrid.as b/frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGrid.as
index 8efb397..231929a 100644
--- a/frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGrid.as
+++ b/frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGrid.as
@@ -2221,12 +2221,12 @@ public class AdvancedDataGrid extends AdvancedDataGridBaseEx
      */
     override protected function createHeaders(left:Number, top:Number):void
     {       
-        if(!columnGrouping)
+        if (!columnGrouping)
         {
             var creatingHeaders:Boolean = false;
-            if(horizontalScrollPolicy != ScrollPolicy.OFF && getOptimumColumns()!= visibleColumns)
+            if (horizontalScrollPolicy != ScrollPolicy.OFF && getOptimumColumns()!= visibleColumns)
             {
-                if(!headerItems[0] || !headerItems[0][0] || (top < headerItems[0][0].y + headerItems[0][0].height)) 
+                if (!headerItems[0] || !headerItems[0][0] || (top < headerItems[0][0].y + headerItems[0][0].height)) 
                     creatingHeaders = true;
             }
 
@@ -2813,7 +2813,7 @@ public class AdvancedDataGrid extends AdvancedDataGridBaseEx
         // based on the dataProvider. Thus setting of columns by dataProvider
         // falls in the same cycle of commitProperties and if moved above will 
         // not get picked unless a second call to commitProperties come
-        if(groupedColumnsChanged)
+        if (groupedColumnsChanged)
         {
             columnGrouping = true;
             columnsChanged = false;
@@ -2833,19 +2833,23 @@ public class AdvancedDataGrid extends AdvancedDataGridBaseEx
 
             super.columns = getLeafColumns(_groupedColumns.slice(0));
         }
-        else if(columnsChanged)
+        else if (columnsChanged)
         {
             columnGrouping = false;
             columnsChanged = false;
 
             removeOldHeaders();
+			
+			columnsToInfo = new Dictionary();
+			headerInfos = initializeHeaderInfo(_columnsValue);
+			
+			headerInfoInitialized = true;
 
             super.columns = _columnsValue;
         }
 
         if (displayItemsExpandedChanged)
         {
-            displayItemsExpandedChanged = false;
             // if displayItemsExpanded is set to true, then expand all the items.
             if (displayItemsExpanded)
                 expandAll();
@@ -3324,15 +3328,15 @@ public class AdvancedDataGrid extends AdvancedDataGridBaseEx
     
     /**
      *  @private
-     *  Initialized the headerInfos structure w.r.t to the groupedColumns 
+     *  Initialized the headerInfos structure w.r.t to the columns 
      *  configuration
      */
-    override protected function initializeHeaderInfo(groupedColumns:Array):Array
+    override protected function initializeHeaderInfo(columns:Array):Array
     {
-        if(!columnGrouping)
-            return super.initializeHeaderInfo(groupedColumns);
+        if (!columnGrouping)
+            return super.initializeHeaderInfo(columns);
         else
-            return initializeGroupedHeaderInfo(groupedColumns, null,0,null);
+            return initializeGroupedHeaderInfo(columns, null,0,null);
     }
     
     /**
@@ -3340,7 +3344,7 @@ public class AdvancedDataGrid extends AdvancedDataGridBaseEx
      */
     override protected function createDisplayableColumns():void
     {
-        if(!columnGrouping)
+        if (!columnGrouping)
         {
             super.createDisplayableColumns();
         }
@@ -3364,7 +3368,7 @@ public class AdvancedDataGrid extends AdvancedDataGridBaseEx
      */
     override protected function updateVisibleHeaders():Array
     {
-        if(!columnGrouping)
+        if (!columnGrouping)
             return super.updateVisibleHeaders();
         else
             return updateVisibleHeaderInfos(headerInfos).infos;