This is an automated email from the ASF dual-hosted git repository. aharui pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit 8959923bba8087d43f6bd185d0ae5fc9da6168c9 Author: Alex Harui <aha...@apache.org> AuthorDate: Tue Nov 12 22:58:59 2019 -0800 fix invisible columns. Fixes #557 --- .../AdvancedDataGridColumn.as | 3 +++ .../mx/controls/beads/AdvancedDataGridView.as | 24 ++++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/advancedDataGridClasses/AdvancedDataGridColumn.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/advancedDataGridClasses/AdvancedDataGridColumn.as index 7e14643..3faccd6 100644 --- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/advancedDataGridClasses/AdvancedDataGridColumn.as +++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/advancedDataGridClasses/AdvancedDataGridColumn.as @@ -23,6 +23,7 @@ package mx.controls.advancedDataGridClasses /* import flash.display.DisplayObject; import flash.events.Event; */ +import org.apache.royale.core.UIBase; import org.apache.royale.events.Event; import mx.controls.AdvancedDataGrid; //BaseEx; @@ -300,6 +301,8 @@ public class AdvancedDataGridColumn extends DataGridColumn */ mx_internal var owner:AdvancedDataGrid; //BaseEx; + mx_internal var list:UIBase; //BaseEx; + /** * @private */ diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/AdvancedDataGridView.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/AdvancedDataGridView.as index c3bcfe7..b5fe4aa 100644 --- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/AdvancedDataGridView.as +++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/AdvancedDataGridView.as @@ -33,6 +33,9 @@ package mx.controls.beads import mx.controls.advancedDataGridClasses.AdvancedDataGridColumnList; import mx.controls.AdvancedDataGrid; + import mx.core.mx_internal; + use namespace mx_internal; + /** * The AlertView class. * @@ -73,15 +76,19 @@ package mx.controls.beads var sharedModel:IDataGridModel = (host.model as IDataGridModel); var visibleColumns:Array = []; - for (var i:int=0; i < columnLists.length; i++) + columnLists.length = 0; + for (var i:int=0; i < sharedModel.columns.length; i++) { - var list:AdvancedDataGridColumnList = columnLists[i] as AdvancedDataGridColumnList; + var list:AdvancedDataGridColumnList = (sharedModel.columns[i] as AdvancedDataGridColumn).list as AdvancedDataGridColumnList; var adgColumnListModel:DataGridColumnICollectionViewModel = list.getBeadByType(DataGridColumnICollectionViewModel) as DataGridColumnICollectionViewModel; adgColumnListModel.columnIndex = i; list.visible = (sharedModel.columns[i] as AdvancedDataGridColumn).visible; list.addEventListener(ItemClickEvent.ITEM_CLICK, itemClickHandler); if (list.visible) + { visibleColumns.push(sharedModel.columns[i]); + columnLists.push(list); + } } (header as DataGridButtonBar).dataProvider = visibleColumns; @@ -92,5 +99,18 @@ package mx.controls.beads { host.dispatchEvent(event); } + + override protected function createLists():void + { + super.createLists(); + var host:IDataGrid = _strand as IDataGrid; + var sharedModel:IDataGridModel = (host.model as IDataGridModel); + + for (var i:int=0; i < sharedModel.columns.length; i++) + { + (sharedModel.columns[i] as AdvancedDataGridColumn).list = columnLists[i]; + } + } + } }