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/03 09:25:18 UTC

[royale-asjs] 01/01: changes to reproduce issue with presentation model in DataGridView

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

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

commit 465059abd9fa6a978594f1ad0331a9a3250f5bee
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Thu Sep 3 11:25:03 2020 +0200

    changes to reproduce issue with presentation model in DataGridView
---
 .../royale/jewel/beads/views/DataGridView.as       | 28 ++++++++++------------
 .../supportClasses/datagrid/IDataGridColumnList.as |  2 +-
 2 files changed, 13 insertions(+), 17 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 cb42ab1..894b8e4 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
@@ -48,6 +48,7 @@ package org.apache.royale.jewel.beads.views
 	import org.apache.royale.utils.IEmphasis;
 	import org.apache.royale.utils.loadBeadFromValuesManager;
 	import org.apache.royale.utils.observeElementSize;
+	import org.apache.royale.jewel.supportClasses.list.IListPresentationModel;
     
     /**
      *  The DataGridView class is the visual bead for the org.apache.royale.jewel.DataGrid.
@@ -233,26 +234,21 @@ 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);
+(_listArea as IParent).addElement(list as IChild);
 
-                columnLists.push(list);
-            }
-        }
+var pm:DataGridColumnListPresentationModel = list.getBeadByType(IListPresentationModel) as DataGridColumnListPresentationModel;
+var zzz:Object = list.getBeadByType(IListPresentationModel);
+COMPILE::JS {
+    console.log(zzz, zzz as DataGridColumnListPresentationModel);
+}
+pm.rowHeight = _presentationModel.rowHeight;
+pm.variableRowHeight = false;
+pm.align = list.columnInfo.align;
 
-        /**
-         * @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;
+columnLists.push(list);
+            }
         }
 
         protected function destroyLists():void
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/IDataGridColumnList.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/IDataGridColumnList.as
index a5fe2fd..333d421 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/IDataGridColumnList.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/IDataGridColumnList.as
@@ -31,7 +31,7 @@ package org.apache.royale.jewel.supportClasses.datagrid
      *  @playerversion AIR 2.6
      *  @productversion Royale 0.9.7
      */
-    public interface IDataGridColumnList extends org.apache.royale.html.supportClasses.IDataGridColumnList, IEmphasis, IListWithPresentationModel
+    public interface IDataGridColumnList extends org.apache.royale.html.supportClasses.IDataGridColumnList, IEmphasis//, IListWithPresentationModel
     {
         function get rollOverIndex():int;
         function set rollOverIndex(value:int):void;