flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carlosrov...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - Rows in mdl tables
Date Fri, 13 Jan 2017 20:19:52 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop ad1fef167 -> 4fbbfd81e


Rows in mdl tables


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/4fbbfd81
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/4fbbfd81
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/4fbbfd81

Branch: refs/heads/develop
Commit: 4fbbfd81e11358dda7bb0d32c7e25ce124c4d144
Parents: ad1fef1
Author: Carlos Rovira <carlosrovira@apache.org>
Authored: Fri Jan 13 21:19:49 2017 +0100
Committer: Carlos Rovira <carlosrovira@apache.org>
Committed: Fri Jan 13 21:19:49 2017 +0100

----------------------------------------------------------------------
 .../src/main/flex/org/apache/flex/mdl/Table.as  | 36 ++++++++++++++++----
 .../flex/mdl/itemRenderers/TableItemRenderer.as |  7 ++--
 2 files changed, 34 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4fbbfd81/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Table.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Table.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Table.as
index b23b834..c1e5240 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Table.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Table.as
@@ -18,6 +18,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.mdl
 {
+	import org.apache.flex.events.Event;
 	import org.apache.flex.mdl.List;
     
     COMPILE::JS
@@ -66,13 +67,34 @@ package org.apache.flex.mdl
         {
 			typeNames = "mdl-data-table mdl-js-data-table";
 
-            element = document.createElement('table') as WrappedHTMLElement;
+            positioner = document.createElement('table') as WrappedHTMLElement;
+			element = document.createElement('tbody') as WrappedHTMLElement;
+
+			positioner.appendChild(element);
             
-			positioner = element;
-            element.flexjs_wrapper = this;
+			element.flexjs_wrapper = this;
 
-            return element;
+            return positioner;
         }
+
+		private var _className:String;
+
+        /**
+         * since we have a div surronding the main input, we need to 
+         * route the class assignaments to div
+         */
+        override public function set className(value:String):void
+		{
+			if (_className != value)
+			{
+                COMPILE::JS
+                {
+                    positioner.className = typeNames ? value + ' ' + typeNames : value; 
           
+                }
+				_className = value;
+				dispatchEvent(new Event("classNameChanged"));
+			}
+		}
 		
 		protected var _shadow:Number = 0;
         /**
@@ -92,13 +114,13 @@ package org.apache.flex.mdl
         {
 			COMPILE::JS
 			{
-				element.classList.remove("mdl-shadow--" + _shadow + "dp");
+				positioner.classList.remove("mdl-shadow--" + _shadow + "dp");
 				
 				if(value == 2 || value == 3 || value == 4 || value == 6 || value == 8 || value == 16)
 				{
 					_shadow = value;
 
-					element.classList.add("mdl-shadow--" + _shadow + "dp");
+					positioner.classList.add("mdl-shadow--" + _shadow + "dp");
 				}
 			}
         }
@@ -124,7 +146,7 @@ package org.apache.flex.mdl
 
 			COMPILE::JS
             {
-				element.classList.toggle("mdl-data-table--selectable", _selectable);
+				positioner.classList.toggle("mdl-data-table--selectable", _selectable);
 			}
         }
 	}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4fbbfd81/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/itemRenderers/TableItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/itemRenderers/TableItemRenderer.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/itemRenderers/TableItemRenderer.as
index c5ae510..95569fd 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/itemRenderers/TableItemRenderer.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/itemRenderers/TableItemRenderer.as
@@ -109,7 +109,10 @@ package org.apache.flex.mdl.itemRenderers
         COMPILE::JS
         override protected function createElement():WrappedHTMLElement
         {
+            positioner = document.createElement('tr') as WrappedHTMLElement;
             element = document.createElement('td') as WrappedHTMLElement;
+
+            positioner.appendChild(element);
             
 			if(MXMLDescriptor == null)
 			{
@@ -117,10 +120,10 @@ package org.apache.flex.mdl.itemRenderers
 				element.appendChild(textNode);
 			}
 
-            positioner = element;
+            //positioner = element;
             element.flexjs_wrapper = this;
             
-            return element;
+            return positioner;
         }
 
 		private var _nonNumeric:Boolean;


Mime
View raw message