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/03/06 12:31:58 UTC

[royale-asjs] branch develop updated: jewel-datagrid: move default width and height to main DataGrid class

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 65eb059  jewel-datagrid: move default width and height to main DataGrid class
65eb059 is described below

commit 65eb059bf6b2275d9072850b760da4c1fad2379f
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Fri Mar 6 13:31:48 2020 +0100

    jewel-datagrid: move default width and height to main DataGrid class
---
 .../Jewel/src/main/royale/org/apache/royale/jewel/DataGrid.as      | 7 ++++++-
 .../royale/org/apache/royale/jewel/beads/views/DataGridView.as     | 7 -------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataGrid.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataGrid.as
index 67bc229..4782833 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataGrid.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataGrid.as
@@ -61,8 +61,13 @@ package org.apache.royale.jewel
 		public function DataGrid()
 		{
 			super();
-			
 			typeNames = "jewel datagrid";
+
+			// set default width and height
+            if(isWidthSizedToContent())
+            	width = 220; // if width not set make it default to 220px
+            if(isHeightSizedToContent())
+            	height = 240; // if height not set make it default to 240px
 		}
 		
 		[Bindable("columnsChanged")]
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 ee3431b..d968768 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
@@ -127,15 +127,8 @@ package org.apache.royale.jewel.beads.views
             COMPILE::JS {	
             _listArea.positioner.style.height = "calc(100% - " + header.height + "px)";
             }
-            
             _dg.strandChildren.addElement(_listArea as IChild);
 
-            // set default width and height
-            if(!_dg.width && (_dg as ILayoutChild).isWidthSizedToContent())
-                _dg.width = 220; // if width not set make it default to 220px
-            if(!_dg.height && (_dg as ILayoutChild).isHeightSizedToContent())
-                _dg.height = 240; // if height not set make it default to 240px
-
             if (_sharedModel.columns)
                 createLists();
         }