You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2020/09/02 13:41:17 UTC

[royale-asjs] branch develop updated: jewe-datagrid: add column list PM at "beadsAdded" tie since is better orchestration and allow PM overrides

This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 358d490  jewe-datagrid: add column list PM at "beadsAdded" tie since is better orchestration and allow PM overrides
358d490 is described below

commit 358d490a5efae3bf6b70645fe0b999a405cdea25
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Wed Sep 2 15:38:03 2020 +0200

    jewe-datagrid: add column list PM at "beadsAdded" tie since is better orchestration and allow PM overrides
---
 .../apache/royale/jewel/beads/views/DataGridView.as    | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as
index 869a8e2..cb42ab1 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as
@@ -206,6 +206,7 @@ package org.apache.royale.jewel.beads.views
                 IEventDispatcher(dataGridColumn).addEventListener("labelChanged", labelChangedHandler);
 
                 var list:IDataGridColumnList = new columnClass();
+                list.columnInfo = dataGridColumn;
                 
                 list.datagrid = _dg as DataGrid;
                 list.emphasis = (_dg as IEmphasis).emphasis;
@@ -232,16 +233,11 @@ package org.apache.royale.jewel.beads.views
                 }
                 list.addEventListener('rollOverIndexChanged', handleColumnListRollOverChange);
                 list.addEventListener('selectionChanged', handleColumnListSelectionChange);
+                list.addEventListener('beadsAdded', configureColumnListPresentationModel);
                 (list as StyledUIBase).tabIndex = -1;
 
                 (_listArea as IParent).addElement(list as IChild);
 
-                // var pm:DataGridColumnListPresentationModel = list.getBeadByType(IListPresentationModel) as DataGridColumnListPresentationModel;
-                var pm:DataGridColumnListPresentationModel = list.presentationModel as DataGridColumnListPresentationModel;
-                pm.rowHeight = _presentationModel.rowHeight;
-                pm.variableRowHeight = false;
-                pm.align = dataGridColumn.align;
-                
                 columnLists.push(list);
             }
         }
@@ -249,6 +245,16 @@ package org.apache.royale.jewel.beads.views
         /**
          * @private
          */
+        protected function configureColumnListPresentationModel(event:Event):void
+        {
+            var list:IDataGridColumnList = event.target as IDataGridColumnList;
+            //var pm:DataGridColumnListPresentationModel = list.getBeadByType(IListPresentationModel) as DataGridColumnListPresentationModel; --> this line doesn't work
+            var pm:DataGridColumnListPresentationModel = list.presentationModel as DataGridColumnListPresentationModel;
+            pm.rowHeight = _presentationModel.rowHeight;
+            pm.variableRowHeight = false;
+            pm.align = list.columnInfo.align;
+        }
+
         protected function destroyLists():void
         {
             var listAreaParent:IParent = listArea as IParent;