flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - Changes for drag and drop support in the DataGrid, especially to provide movable columns.
Date Tue, 19 Sep 2017 19:24:58 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop 008ff2872 -> 88cd277a2


Changes for drag and drop support in the DataGrid, especially to provide movable columns.


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

Branch: refs/heads/develop
Commit: 88cd277a2e6c4038ec4c1359a747e0d5243d4d6a
Parents: 008ff28
Author: Peter Ent <pent@apache.org>
Authored: Tue Sep 19 15:24:56 2017 -0400
Committer: Peter Ent <pent@apache.org>
Committed: Tue Sep 19 15:24:56 2017 -0400

----------------------------------------------------------------------
 .../org/apache/flex/html/beads/DataGridView.as  | 131 +++----
 .../TextItemRendererFactoryForArrayData.as      |  62 ++--
 .../flex/html/beads/models/DataGridModel.as     |  46 ++-
 .../html/supportClasses/DataGridColumnList.as   |   2 +
 .../supportClasses/TextButtonItemRenderer.as    |  77 ++--
 .../flex/org/apache/flex/core/IDataGridModel.as |  15 +-
 .../DragDrop/src/main/flex/DragDropClasses.as   |  14 +-
 .../flex/html/beads/ButtonBarReorderBead.as     | 368 +++++++++++++++++++
 .../DataGridButtonBarViewForMovableColumns.as   |  53 +++
 .../html/beads/DataGridColumnReorderView.as     | 100 +++++
 .../apache/flex/html/beads/DragDropListView.as  |  35 +-
 .../html/beads/SingleSelectionDragImageBead.as  |  58 +--
 .../html/beads/SingleSelectionDragSourceBead.as |  73 ++--
 .../html/beads/SingleSelectionDropTargetBead.as | 187 +++++-----
 .../src/main/resources/basic-manifest.xml       |   4 +
 15 files changed, 921 insertions(+), 304 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/88cd277a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/DataGridView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/DataGridView.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/DataGridView.as
index 58ee8c7..5f58cf5 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/DataGridView.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/DataGridView.as
@@ -37,11 +37,11 @@ package org.apache.flex.html.beads
 	import org.apache.flex.html.supportClasses.DataGridColumn;
 	import org.apache.flex.html.supportClasses.DataGridColumnList;
 	import org.apache.flex.html.supportClasses.Viewport;
-	
+
 	COMPILE::SWF {
 		import org.apache.flex.core.SimpleCSSStylesWithFlex;
 	}
-		
+
 		/**
 		 *  The DataGridView class is the visual bead for the org.apache.flex.html.DataGrid.
 		 *  This class constructs the items that make the DataGrid: Lists for each column and a
@@ -67,13 +67,13 @@ package org.apache.flex.html.beads
 			{
 				super();
 			}
-			
+
 			private var _strand:IStrand;
 			private var _header:DataGridButtonBar;
 			private var _listArea:Container;
-			
+
 			private var _lists:Array;
-			
+
 			/**
 			 * An array of List objects the comprise the columns of the DataGrid.
 			 */
@@ -81,7 +81,7 @@ package org.apache.flex.html.beads
 			{
 				return _lists;
 			}
-			
+
 			/**
 			 * The area used to hold the columns
 			 *
@@ -90,7 +90,7 @@ package org.apache.flex.html.beads
 			{
 				return _listArea;
 			}
-			
+
 			/**
 			 * Returns the component used as the header for the DataGrid.
 			 */
@@ -98,7 +98,7 @@ package org.apache.flex.html.beads
 			{
 				return _header;
 			}
-			
+
 			/**
 			 *  @copy org.apache.flex.core.IBead#strand
 			 *
@@ -111,21 +111,43 @@ package org.apache.flex.html.beads
 			{
 				super.strand = value;
 				_strand = value;
-				
-				var host:DataGrid = value as DataGrid;
-				
+
+				IEventDispatcher(_strand).addEventListener("beadsAdded", finishSetup);
+			}
+
+			public function refreshContent():void
+			{
+				finishSetup(null);
+			}
+
+			/**
+			 * @private
+			 */
+			protected function finishSetup(event:Event):void
+			{
+				var host:DataGrid = _strand as DataGrid;
+
+				// see if there is a presentation model already in place. if not, add one.
+				var presentationModel:IDataGridPresentationModel = host.presentationModel;
+				var sharedModel:IDataGridModel = host.model as IDataGridModel;
+				IEventDispatcher(sharedModel).addEventListener("dataProviderChanged",handleDataProviderChanged);
+				IEventDispatcher(sharedModel).addEventListener("selectedIndexChanged", handleSelectedIndexChanged);
+
 				_header = new DataGridButtonBar();
 				_header.height = 30;
 				_header.percentWidth = 100;
-				
+				_header.dataProvider = sharedModel.columns;
+				_header.labelField = "label";
+				sharedModel.headerModel = _header.model as IBeadModel;
+
 				_listArea = new Container();
 				_listArea.percentWidth = 100;
 				_listArea.className = "opt_org-apache-flex-html-DataGrid_ListArea";
-				
+
 				COMPILE::SWF {
 					_header.style = new SimpleCSSStylesWithFlex();
 					_header.style.flexGrow = 0;
-					
+
 					_listArea.style = new SimpleCSSStylesWithFlex();
 					_listArea.style.flexGrow = 1;
 				}
@@ -134,41 +156,23 @@ package org.apache.flex.html.beads
 					_header.element.style["min-height"] = "30px";
 					_listArea.element.style["flex-grow"] = "1";
 				}
-				
-				IEventDispatcher(_strand).addEventListener("beadsAdded", finishSetup);
-			}
-			
-			/**
-			 * @private
-			 */
-			private function finishSetup(event:Event):void
-			{
-				var host:DataGrid = _strand as DataGrid;
-				
-				if (_lists == null || _lists.length == 0) {
-					createLists();
-				}
-				
-				// see if there is a presentation model already in place. if not, add one.
-				var presentationModel:IDataGridPresentationModel = host.presentationModel;
-				var sharedModel:IDataGridModel = host.model as IDataGridModel;
-				IEventDispatcher(sharedModel).addEventListener("dataProviderChanged",handleDataProviderChanged);
-				IEventDispatcher(sharedModel).addEventListener("selectedIndexChanged", handleSelectedIndexChanged);
-				
-				var columnLabels:Array = new Array();
+
+				createLists();
+
+				//var columnLabels:Array = new Array();
 				var buttonWidths:Array = new Array();
-				
+
 				var marginBorderOffset:int = 0;
 				COMPILE::SWF {
 					marginBorderOffset = 1;
 				}
-					
+
 				for(var i:int=0; i < sharedModel.columns.length; i++) {
 					var dgc:DataGridColumn = sharedModel.columns[i] as DataGridColumn;
-					columnLabels.push(dgc.label);
+					//columnLabels.push(dgc.label);
 					var colWidth:Number = dgc.columnWidth - marginBorderOffset;
 					buttonWidths.push(colWidth);
-					
+
 					var list:DataGridColumnList = _lists[i] as DataGridColumnList;
 					if (!isNaN(colWidth)) {
 						list.width = Number(colWidth - marginBorderOffset);
@@ -182,49 +186,48 @@ package org.apache.flex.html.beads
 							}
 					}
 				}
-					
+
 				var bblayout:ButtonBarLayout = new ButtonBarLayout();
 				_header.buttonWidths = buttonWidths
 				_header.widthType = ButtonBarModel.PIXEL_WIDTHS;
-				_header.dataProvider = columnLabels;
 				_header.addBead(bblayout);
 				_header.addBead(new Viewport());
 				host.addElement(_header);
-				
+
 				host.addElement(_listArea);
-				
+
 				handleDataProviderChanged(event);
-				
+
 				host.addEventListener("widthChanged", handleSizeChanges);
 				host.addEventListener("heightChanged", handleSizeChanges);
 			}
-			
+
 			/**
 			 * @private
 			 */
 			private function handleSizeChanges(event:Event):void
-			{	
+			{
 				_header.dispatchEvent(new Event("layoutChanged"));
 				_listArea.dispatchEvent(new Event("layoutChanged"));
 			}
-			
+
 			/**
 			 * @private
 			 */
 			private function handleDataProviderChanged(event:Event):void
 			{
 				var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
-				
+
 				for (var i:int=0; i < _lists.length; i++)
 				{
 					var list:DataGridColumnList = _lists[i] as DataGridColumnList;
 					var listModel:ISelectionModel = list.getBeadByType(IBeadModel) as ISelectionModel;
 					listModel.dataProvider = sharedModel.dataProvider;
 				}
-				
+
 				host.dispatchEvent(new Event("layoutNeeded"));
 			}
-			
+
 			/**
 			 * @private
 			 */
@@ -232,14 +235,14 @@ package org.apache.flex.html.beads
 			{
 				var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
 				var newIndex:int = sharedModel.selectedIndex;
-				
+
 				for (var i:int=0; i < _lists.length; i++)
 				{
 					var list:DataGridColumnList = _lists[i] as DataGridColumnList;
 					list.selectedIndex = newIndex;
 				}
 			}
-			
+
 			/**
 			 * @private
 			 */
@@ -248,40 +251,40 @@ package org.apache.flex.html.beads
 				var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
 				var list:DataGridColumnList = event.target as DataGridColumnList;
 				sharedModel.selectedIndex = list.selectedIndex;
-				
+
 				for(var i:int=0; i < _lists.length; i++) {
 					if (list != _lists[i]) {
 						var otherList:DataGridColumnList = _lists[i] as DataGridColumnList;
 						otherList.selectedIndex = list.selectedIndex;
 					}
 				}
-				
+
 				host.dispatchEvent(new Event('change'));
 			}
-			
+
 			/**
 			 * @private
 			 */
 			private function createLists():void
 			{
 				var host:DataGrid = _strand as DataGrid;
-				
+
 				var sharedModel:IDataGridModel = host.model as IDataGridModel;
 				var presentationModel:IDataGridPresentationModel = host.presentationModel;
-				
+
 				_lists = new Array();
-				
+
 				for (var i:int=0; i < sharedModel.columns.length; i++) {
 					var dataGridColumn:DataGridColumn = sharedModel.columns[i] as DataGridColumn;
-					
+
 					var list:DataGridColumnList = new DataGridColumnList();
 					list.id = "dataGridColumn"+String(i);
-					list.addBead(sharedModel);
+					list.dataProvider = sharedModel.dataProvider;
 					list.itemRenderer = dataGridColumn.itemRenderer;
 					list.labelField = dataGridColumn.dataField;
 					list.addEventListener('change',handleColumnListChange);
 					list.addBead(presentationModel);
-					
+
 					if (i == 0) {
 						list.className = "first";
 					} else if (i == sharedModel.columns.length-1) {
@@ -289,11 +292,11 @@ package org.apache.flex.html.beads
 					} else {
 						list.className = "middle";
 					}
-					
+
 					_listArea.addElement(list);
 					_lists.push(list);
 				}
-				
+
 				host.dispatchEvent(new Event("layoutNeeded"));
 			}
 		}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/88cd277a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/TextItemRendererFactoryForArrayData.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/TextItemRendererFactoryForArrayData.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/TextItemRendererFactoryForArrayData.as
index 7752e90..db5c7d0 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/TextItemRendererFactoryForArrayData.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/TextItemRendererFactoryForArrayData.as
@@ -30,17 +30,17 @@ package org.apache.flex.html.beads
 	import org.apache.flex.events.EventDispatcher;
 	import org.apache.flex.events.ItemRendererEvent;
     import org.apache.flex.events.IEventDispatcher;
-	
+
 	[Event(name="itemRendererCreated",type="org.apache.flex.events.ItemRendererEvent")]
 
     /**
-     *  The TextItemRendererFactoryForArrayData class is the 
-     *  IDataProviderItemRendererMapper for creating 
+     *  The TextItemRendererFactoryForArrayData class is the
+     *  IDataProviderItemRendererMapper for creating
      *  ITextItemRenderers and assigning them data from an array.
      *  Other IDataProviderItemRendererMapper implementations
      *  assign specific array or vector types to item
      *  renderers expecting those types.
-     *  
+     *
      *  @langversion 3.0
      *  @playerversion Flash 10.2
      *  @playerversion AIR 2.6
@@ -50,7 +50,7 @@ package org.apache.flex.html.beads
 	{
         /**
          *  Constructor.
-         *  
+         *
          *  @langversion 3.0
          *  @playerversion Flash 10.2
          *  @playerversion AIR 2.6
@@ -60,14 +60,14 @@ package org.apache.flex.html.beads
 		{
 			super(target);
 		}
-		
+
 		private var selectionModel:ISelectionModel;
-		
+
 		private var _strand:IStrand;
-		
+
         /**
          *  @copy org.apache.flex.core.IBead#strand
-         *  
+         *
          *  @langversion 3.0
          *  @playerversion Flash 10.2
          *  @playerversion AIR 2.6
@@ -78,13 +78,13 @@ package org.apache.flex.html.beads
 			_strand = value;
 			IEventDispatcher(value).addEventListener("initComplete",finishSetup);
 		}
-		
+
 		private function finishSetup(event:Event):void
 		{
 			selectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
 			selectionModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
-            
-			// if the host component inherits from DataContainerBase, the itemRendererClassFactory will 
+
+			// if the host component inherits from DataContainerBase, the itemRendererClassFactory will
 			// already have been loaded by DataContainerBase.addedToParent function.
             if (!itemRendererFactory)
             {
@@ -95,15 +95,15 @@ package org.apache.flex.html.beads
     	            _strand.addBead(_itemRendererFactory);
 				}
             }
-            
+
 			dataProviderChangeHandler(null);
 		}
-		
+
         private var _itemRendererFactory:IItemRendererClassFactory;
-        
+
         /**
          *  An IItemRendererClassFactory that should generate ITextItemRenderers
-         *  
+         *
          *  @langversion 3.0
          *  @playerversion Flash 10.2
          *  @playerversion AIR 2.6
@@ -113,7 +113,7 @@ package org.apache.flex.html.beads
         {
             return _itemRendererFactory
         }
-        
+
         /**
          *  @private
          */
@@ -121,44 +121,44 @@ package org.apache.flex.html.beads
         {
             _itemRendererFactory = value;
         }
-        
+
         /**
          *  The IItemRendererParent that should parent the ITextItemRenderers
-         *  
+         *
          *  @langversion 3.0
          *  @playerversion Flash 10.2
          *  @playerversion AIR 2.6
          *  @productversion FlexJS 0.0
-         */		
+         */
 		private function dataProviderChangeHandler(event:Event):void
 		{
 			var dp:Array = selectionModel.dataProvider as Array;
 			if (!dp)
 				return;
-			
+
 			var list:IList = _strand as IList;
 			var dataGroup:IItemRendererParent = list.dataGroup;
-			
+
 			dataGroup.removeAllItemRenderers();
-			
-			var n:int = dp.length; 
+
+			var n:int = dp.length;
 			for (var i:int = 0; i < n; i++)
 			{
 				var tf:ITextItemRenderer = itemRendererFactory.createItemRenderer(dataGroup) as ITextItemRenderer;
                 tf.index = i;
                 dataGroup.addItemRenderer(tf);
-                if (selectionModel.labelField)
-                    tf.text = dp[i][selectionModel.labelField];
-                else
-    				tf.text = dp[i];
-				
+                if (selectionModel.labelField) {
+                	tf.labelField = selectionModel.labelField;
+                }
+                tf.data = dp[i];
+
 				var newEvent:ItemRendererEvent = new ItemRendererEvent(ItemRendererEvent.CREATED);
 				newEvent.itemRenderer = tf;
 				dispatchEvent(newEvent);
 			}
-			
+
 			IEventDispatcher(_strand).dispatchEvent(new Event("itemsCreated"));
 		}
-		
+
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/88cd277a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/models/DataGridModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/models/DataGridModel.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/models/DataGridModel.as
index 531edac..c709108 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/models/DataGridModel.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/models/DataGridModel.as
@@ -18,13 +18,14 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.html.beads.models
 {
+	import org.apache.flex.core.IBeadModel;
 	import org.apache.flex.core.IDataGridModel;
 	import org.apache.flex.events.Event;
-	
+
 	/**
-	 *  The DataGridModel class bead extends org.apache.flex.html.beads.models.ArrayListSelectionModel 
+	 *  The DataGridModel class bead extends org.apache.flex.html.beads.models.ArrayListSelectionModel
 	 *  to facilitate using an ArrayList as the dataProvider for the DataGrid.
-	 *  
+	 *
 	 *  @langversion 3.0
 	 *  @playerversion Flash 10.2
 	 *  @playerversion AIR 2.6
@@ -34,7 +35,7 @@ package org.apache.flex.html.beads.models
 	{
 		/**
 		 *  constructor.
-		 *  
+		 *
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
@@ -44,13 +45,13 @@ package org.apache.flex.html.beads.models
 		{
 			super();
 		}
-		
+
 		private var _columns:Array;
-		
+
 		/**
-		 *  The array of org.apache.flex.html.supportClasses.DataGridColumns used to 
+		 *  The array of org.apache.flex.html.supportClasses.DataGridColumns used to
 		 *  define each column of the org.apache.flex.html.DataGrid.
-		 *  
+		 *
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
@@ -67,5 +68,34 @@ package org.apache.flex.html.beads.models
 				dispatchEvent( new Event("columnsChanged"));
 			}
 		}
+
+		private var _headerModel:IBeadModel;
+
+		/**
+		 * The model to use for the DataGrid's header.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.9
+		 */
+		public function get headerModel():IBeadModel
+		{
+			return _headerModel;
+		}
+		public function set headerModel(value:IBeadModel):void
+		{
+			if (_headerModel != value) {
+				_headerModel = value;
+				dispatchEvent(new Event("headerModelChanged"));
+
+				_headerModel.addEventListener("dataProviderChanged", handleHeaderModelChange);
+			}
+		}
+
+		private function handleHeaderModelChange(event:Event):void
+		{
+			dispatchEvent(new Event("headerModelChanged"));
+		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/88cd277a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DataGridColumnList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DataGridColumnList.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DataGridColumnList.as
index e612517..8db6437 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DataGridColumnList.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DataGridColumnList.as
@@ -58,5 +58,7 @@ package org.apache.flex.html.supportClasses
 			super();
 			typeNames = "DataGridColumnList";
 		}
+		
+		public var columnInfo: DataGridColumn;
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/88cd277a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/TextButtonItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/TextButtonItemRenderer.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/TextButtonItemRenderer.as
index b164f97..dba0b93 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/TextButtonItemRenderer.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/TextButtonItemRenderer.as
@@ -27,12 +27,12 @@ package org.apache.flex.html.supportClasses
 	import org.apache.flex.html.TextButton;
 	import org.apache.flex.html.beads.ITextItemRenderer;
 	import org.apache.flex.events.ItemClickedEvent;
-	
+
 	COMPILE::JS
 	{
-		import org.apache.flex.core.WrappedHTMLElement;            
+		import org.apache.flex.core.WrappedHTMLElement;
 	}
-	
+
 	/**
 	 * The TextButtonItemRenderer class extends TextButton and turns it into an itemRenderer
 	 * suitable for use in most DataContainer/List/DataGrid applications.
@@ -47,14 +47,14 @@ package org.apache.flex.html.supportClasses
 		public function TextButtonItemRenderer()
 		{
 			super();
-			
+
 			style = new SimpleCSSStylesWithFlex();
-			
+
 			addEventListener('click',handleClickEvent);
 		}
-		
+
 		private var _data:Object;
-		
+
 		/**
 		 *  The data to be displayed as the text value. Use this in conjunction with
 		 *  the labelField property to select an item from the dataProvider record to use
@@ -72,22 +72,32 @@ package org.apache.flex.html.supportClasses
 		public function set data(value:Object):void
 		{
 			_data = value;
-			
+
+			updateButtonLabelFromData();
+		}
+
+		private function updateButtonLabelFromData():void
+		{
 			var valueAsString:String;
-			
-			if (value is String) {
-				valueAsString = value as String;
+
+			if (data == null) return;
+
+			if (data is String) {
+				valueAsString = data as String;
+			}
+			else if (labelField != null) {
+				valueAsString = String(data[labelField]);
 			}
-			else if (value.hasOwnProperty("label")) {
-				valueAsString = String(value["label"]);
+			else if (data.hasOwnProperty("label")) {
+				valueAsString = String(data["label"]);
 			}
-			else if (value.hasOwnProperty("title")) {
-				valueAsString = String(value["title"]);
+			else if (data.hasOwnProperty("title")) {
+				valueAsString = String(data["title"]);
 			}
-			
+
 			if (valueAsString) text = valueAsString;
 		}
-		
+
 		/**
 		 * @private
 		 */
@@ -99,13 +109,13 @@ package org.apache.flex.html.supportClasses
 			newEvent.data = data;
 			dispatchEvent(newEvent);
 		}
-		
+
 		/*
 		 * IItemRenderer, ISelectableItemRenderer
 		 */
-		
+
 		private var _itemRendererParent:Object;
-		
+
 		/**
 		 * The parent container for the itemRenderer instance.
 		 *
@@ -122,9 +132,9 @@ package org.apache.flex.html.supportClasses
 		{
 			_itemRendererParent = value;
 		}
-		
-		private var _labelField:String = "label";
-		
+
+		private var _labelField:String = null;
+
 		/**
 		 * The name of the field within the data to use as a label. Some itemRenderers use this field to
 		 * identify the value they should show while other itemRenderers ignore this if they are showing
@@ -142,10 +152,11 @@ package org.apache.flex.html.supportClasses
 		public function set labelField(value:String):void
 		{
 			_labelField = value;
+			updateButtonLabelFromData();
 		}
-		
+
 		private var _listData:Object;
-		
+
 		[Bindable("__NoChangeEvent__")]
 		/**
 		 *  Additional data about the list structure the itemRenderer may
@@ -164,9 +175,9 @@ package org.apache.flex.html.supportClasses
 		{
 			_listData = value;
 		}
-		
+
 		private var _index:int;
-		
+
 		/**
 		 *  The position with the dataProvider being shown by the itemRenderer instance.
 		 *
@@ -183,9 +194,9 @@ package org.apache.flex.html.supportClasses
 		{
 			_index = value;
 		}
-		
+
 		private var _hovered:Boolean;
-		
+
 		/**
 		 *  Whether or not the itemRenderer is in a hovered state.
 		 *
@@ -202,9 +213,9 @@ package org.apache.flex.html.supportClasses
 		{
 			_hovered = value;
 		}
-		
+
 		private var _selected:Boolean;
-		
+
 		/**
 		 *  Whether or not the itemRenderer is in a selected state.
 		 *
@@ -221,9 +232,9 @@ package org.apache.flex.html.supportClasses
 		{
 			_selected = value;
 		}
-		
+
 		private var _down:Boolean;
-		
+
 		/**
 		 *  Whether or not the itemRenderer is in a down (or pre-selected) state.
 		 *

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/88cd277a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IDataGridModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IDataGridModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IDataGridModel.as
index e0948da..3b5b222 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IDataGridModel.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IDataGridModel.as
@@ -22,14 +22,14 @@ package org.apache.flex.core
      *  The IDataGridModel interface describes the minimum set of properties
      *  available to an DataGrid control.  More sophisticated DataGrid controls
      *  could have models that extend IDataGridModel.
-     *  
+     *
      *  @langversion 3.0
      *  @playerversion Flash 10.2
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
 	public interface IDataGridModel extends ISelectionModel
-	{		
+	{
         /**
          *  The set of DataGridColumns.
          *
@@ -40,5 +40,16 @@ package org.apache.flex.core
          */
 		function get columns():Array;
 		function set columns(value:Array):void;
+
+		/**
+		 * The model to use for the DataGrid's header.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.9
+		 */
+		function get headerModel():IBeadModel;
+		function set headerModel(value:IBeadModel):void;
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/88cd277a/frameworks/projects/DragDrop/src/main/flex/DragDropClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/DragDrop/src/main/flex/DragDropClasses.as b/frameworks/projects/DragDrop/src/main/flex/DragDropClasses.as
index 0ae4f1c..c62250d 100644
--- a/frameworks/projects/DragDrop/src/main/flex/DragDropClasses.as
+++ b/frameworks/projects/DragDrop/src/main/flex/DragDropClasses.as
@@ -26,21 +26,25 @@ package
  *  from the classes specified in manifest.xml.
  */
 internal class DragDropClasses
-{	  
+{
     import org.apache.flex.core.DropType; DropType;
-    import org.apache.flex.events.DragEvent; DragEvent;   
-	
+    import org.apache.flex.events.DragEvent; DragEvent;
+
 	import org.apache.flex.html.beads.SingleSelectionDragImageBead; SingleSelectionDragImageBead;
 	import org.apache.flex.html.beads.SingleSelectionDragSourceBead; SingleSelectionDragSourceBead;
 	import org.apache.flex.html.beads.SingleSelectionDropIndicatorBead; SingleSelectionDropIndicatorBead;
 	import org.apache.flex.html.beads.SingleSelectionDropTargetBead; SingleSelectionDropTargetBead;
-	
+
 	import org.apache.flex.html.beads.DataGridDrawingLayerBead; DataGridDrawingLayerBead;
 	import org.apache.flex.html.beads.DataGridWithDrawingLayerLayout; DataGridWithDrawingLayerLayout;
 	import org.apache.flex.html.beads.IDrawingLayerBead; IDrawingLayerBead;
 	import org.apache.flex.html.beads.DragDropListView; DragDropListView;
 	import org.apache.flex.html.beads.ListDrawingLayerBead; ListDrawingLayerBead;
-	
+
+	import org.apache.flex.html.beads.DataGridButtonBarViewForMovableColumns; DataGridButtonBarViewForMovableColumns;
+	import org.apache.flex.html.beads.DataGridColumnReorderView; DataGridColumnReorderView;
+	import org.apache.flex.html.beads.ButtonBarReorderBead; ButtonBarReorderBead;
+
 }
 
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/88cd277a/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/ButtonBarReorderBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/ButtonBarReorderBead.as b/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/ButtonBarReorderBead.as
new file mode 100644
index 0000000..cc66ba7
--- /dev/null
+++ b/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/ButtonBarReorderBead.as
@@ -0,0 +1,368 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+	import org.apache.flex.collections.ArrayList;
+	import org.apache.flex.core.IBead;
+	import org.apache.flex.core.IDataProviderModel;
+	import org.apache.flex.core.IDocument;
+	import org.apache.flex.core.IDragInitiator;
+	import org.apache.flex.core.IItemRenderer;
+	import org.apache.flex.core.IItemRendererParent;
+	import org.apache.flex.core.IParent;
+	import org.apache.flex.core.IChild;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.core.IUIBase;
+	import org.apache.flex.core.UIBase;
+	import org.apache.flex.events.DragEvent;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.EventDispatcher;
+	import org.apache.flex.events.IEventDispatcher;
+	import org.apache.flex.geom.Point;
+	import org.apache.flex.geom.Rectangle;
+	import org.apache.flex.html.Group;
+	import org.apache.flex.html.Label;
+	import org.apache.flex.html.beads.controllers.DragMouseController;
+	import org.apache.flex.html.beads.controllers.DropMouseController;
+	import org.apache.flex.html.supportClasses.DataItemRenderer;
+	import org.apache.flex.utils.PointUtils;
+	import org.apache.flex.utils.UIUtils;
+
+
+	/**
+	 *  The ButtonBarReorderBead bead can be added to a ButtonBar to re-order the buttons
+	 *  using drag-and-drop. This bead will add additional beads as necessary.
+	 *
+	 *  @see org.apache.flex.html.beads.SingleSelectionDropTargetBead.
+     *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.8
+	 */
+	public class ButtonBarReorderBead extends EventDispatcher implements IBead
+	{
+		/**
+		 * Constructor
+	     *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.8
+		 */
+		public function ButtonBarReorderBead()
+		{
+			super();
+		}
+
+		private var _strand:IStrand;
+		private var _dragController:DragMouseController;
+		private var _dropController:DropMouseController;
+		private var _dropIndicatorBead:SingleSelectionDropIndicatorBead;
+		private var _dropIndicator:UIBase;
+		private var lastItemVisited:Object;
+		private var indicatorVisible:Boolean = false;
+		private var dropDirection:String;
+
+		/**
+		 * @private
+		 */
+		public function set strand(value:IStrand):void
+		{
+			_strand = value;
+
+			dropDirection = "horizontal";
+
+			_dragController = new DragMouseController();
+			_strand.addBead(_dragController);
+
+			IEventDispatcher(_strand).addEventListener(DragEvent.DRAG_START, handleDragStart);
+			IEventDispatcher(_strand).addEventListener(DragEvent.DRAG_MOVE, handleDragMove);
+			IEventDispatcher(_strand).addEventListener(DragEvent.DRAG_END, handleDragEnd);
+
+			_dropController = new DropMouseController();
+			_strand.addBead(_dropController);
+
+			IEventDispatcher(_dropController).addEventListener(DragEvent.DRAG_ENTER, handleDragEnter);
+			IEventDispatcher(_dropController).addEventListener(DragEvent.DRAG_EXIT, handleDragExit);
+			IEventDispatcher(_dropController).addEventListener(DragEvent.DRAG_OVER, handleDragOver);
+			IEventDispatcher(_dropController).addEventListener(DragEvent.DRAG_DROP, handleDragDrop);
+		}
+
+		/**
+		 * @private
+		 * The index of the item being moved
+		 */
+		private var sourceIndex:int = -1;
+
+		/**
+		 * @private
+		 * The index of where the item is being moved before or if -1,
+		 * the item is being put at the end.
+		 */
+		private var targetIndex:int = -1;
+
+		/**
+		 * @private
+		 */
+		private function handleDragStart(event:DragEvent):void
+		{
+			trace("ButtonBarReorderBead received the DragStart");
+
+			DragMouseController.dragImageOffsetX = 0;
+			DragMouseController.dragImageOffsetY = -30;
+
+			var startHere:Object = event.target;
+			while (!(startHere is IItemRenderer) && startHere != null) {
+				startHere = startHere.itemRendererParent;
+			}
+			if (startHere is IItemRenderer) {
+				var p:UIBase = startHere.itemRendererParent as UIBase;
+				sourceIndex = p.getElementIndex(startHere as IChild);
+				DragEvent.dragSource = (startHere as IItemRenderer).data;
+			}
+		}
+
+		/**
+		 * @private
+		 */
+		protected function handleDragMove(event:DragEvent):void
+		{
+		}
+
+		/**
+		 * @private
+		 */
+		protected function handleDragEnd(event:DragEvent):void
+		{
+		}
+
+		/**
+		 * @private
+		 */
+		private function handleDragEnter(event:DragEvent):void
+		{
+			trace("ButtonBarReorderBead received DragEnter via: "+event.relatedObject.toString());
+			var pt0:Point;
+			var pt1:Point;
+			var pt2:Point;
+
+			var startHere:Object = event.relatedObject;
+			while( !(startHere is IItemRenderer) && startHere != null) {
+				startHere = startHere.parent;
+			}
+
+			if (startHere is IItemRenderer) {
+				var ir:IItemRenderer = startHere as IItemRenderer;
+				lastItemVisited = ir;
+			}
+
+			if (lastItemVisited && !indicatorVisible && indicatorParent) {
+				var di:UIBase = getDropIndicator(lastItemVisited, (dropDirection == "horizontal") ? indicatorParent.width : 4,
+					                             (dropDirection == "horizontal") ? 4 : indicatorParent.height);
+				indicatorVisible = true;
+				displayDropIndicator(lastItemVisited as IUIBase);
+
+				if (indicatorParent != null) {
+					indicatorParent.addElement(di);
+				}
+			}
+
+		}
+
+		/**
+		 * @private
+		 */
+		private function handleDragOver(event:DragEvent):void
+		{
+			trace("ButtonBarReorderBead received DragOver via: "+event.relatedObject.toString());
+			var pt0:Point;
+			var pt1:Point;
+			var pt2:Point;
+
+			var startHere:Object = event.relatedObject;
+			while( !(startHere is IItemRenderer) && startHere != null) {
+				startHere = startHere.parent;
+			}
+
+			if ((startHere is IItemRenderer) && _dropIndicator != null && indicatorParent) {
+				displayDropIndicator(startHere as IUIBase);
+				lastItemVisited = startHere;
+
+			}
+			else if (lastItemVisited && _dropIndicator != null && indicatorParent) {
+				var lastItem:UIBase = lastItemVisited as UIBase;
+				displayDropIndicator(lastItemVisited as IUIBase);
+			}
+		}
+
+		/**
+		 * @private
+		 */
+		private function handleDragExit(event:DragEvent):void
+		{
+			trace("ButtonBarReorderBead received DragExit via: "+event.relatedObject.toString());
+
+			if (indicatorVisible) {
+				if (indicatorParent != null) {
+					indicatorParent.removeElement(_dropIndicator);
+				}
+				indicatorVisible = false;
+			}
+		}
+
+		/**
+		 * @private
+		 */
+		private function handleDragDrop(event:DragEvent):void
+		{
+			trace("ButtonBarReorderBead received DragDrop via: "+event.relatedObject.toString());
+
+			handleDragExit(event);
+
+			targetIndex = -1; // assume after the end unless proven otherwise.
+
+			var itemRendererParent:UIBase;
+
+			var startHere:Object = event.relatedObject;
+			while( !(startHere is IItemRenderer) && startHere != null) {
+				startHere = startHere.parent;
+			}
+
+			if (startHere is IItemRenderer) {
+				var ir:IItemRenderer = startHere as IItemRenderer;
+				trace("-- dropping onto an existing object: "+ir.data.toString());
+
+				itemRendererParent = ir.itemRendererParent as UIBase;
+				targetIndex = itemRendererParent.getElementIndex(ir);
+			}
+			else  {
+				itemRendererParent = startHere.itemRendererParent as UIBase;
+				trace("-- dropping after the last item");
+			}
+
+			var dataProviderModel:IDataProviderModel = _strand.getBeadByType(IDataProviderModel) as IDataProviderModel;
+
+			var dragSource:Object;
+
+			if (dataProviderModel.dataProvider is Array) {
+				var dataArray:Array = dataProviderModel.dataProvider as Array;
+
+				dragSource = dataArray[sourceIndex];
+
+ 				// remove the item from its original position
+ 				dataArray.splice(sourceIndex,1)
+
+				// insert the item being dropped
+				if (targetIndex == -1) {
+					// append to the end
+					dataArray.push(dragSource);
+				} else {
+					// insert before targetIndex
+					dataArray.splice(targetIndex, 0, dragSource);
+				}
+
+				var newArray:Array = dataArray.slice()
+				dataProviderModel.dataProvider = newArray;
+			}
+			else if (dataProviderModel.dataProvider is ArrayList) {
+				var dataList:ArrayList = dataProviderModel.dataProvider as ArrayList;
+
+				dragSource = dataList.getItemAt(sourceIndex);
+
+ 				// remove the item from its original position
+ 				dataList.removeItemAt(sourceIndex);
+
+				// insert the item being dropped
+				if (targetIndex == -1) {
+					// sppend to the end
+					dataList.addItem(dragSource);
+				} else {
+					// insert before target index
+					dataList.addItemAt(dragSource, targetIndex);
+				}
+
+				var newList:ArrayList = new ArrayList(dataList.source);
+				dataProviderModel.dataProvider = newList;
+			}
+		}
+
+		protected var _indicatorParent:UIBase;
+
+		protected function get indicatorParent():UIBase
+		{
+			if (_indicatorParent == null) {
+				var layerBead:IDrawingLayerBead = _strand.getBeadByType(IDrawingLayerBead) as IDrawingLayerBead;
+				if (layerBead != null) {
+					_indicatorParent = layerBead.layer;
+				}
+			}
+			return _indicatorParent;
+		}
+
+		/**
+		 * @private
+		 */
+		protected function getDropIndicator(ir:Object, width:Number, height:Number):UIBase
+		{
+			if (_dropIndicatorBead == null) {
+				_dropIndicatorBead = _strand.getBeadByType(SingleSelectionDropIndicatorBead) as SingleSelectionDropIndicatorBead;
+				if (_dropIndicatorBead == null) return null;
+			}
+			_dropIndicator = _dropIndicatorBead.getDropIndicator(ir, width, height);
+			return _dropIndicator;
+		}
+
+		COMPILE::SWF
+		private function displayDropIndicator(item:IUIBase):void
+		{
+			var pt0:Point;
+			var pt1:Point;
+			var pt2:Point;
+
+			if (dropDirection == "horizontal") {
+				pt0 = new Point(0, item.y);
+				pt1 = PointUtils.localToGlobal(pt0, item.parent);
+				pt2 = PointUtils.globalToLocal(pt1, indicatorParent);
+				_dropIndicator.x = 0;
+				_dropIndicator.y = pt2.y - 1;
+			}
+			else {
+				pt0 = new Point(item.x, 0);
+				pt1 = PointUtils.localToGlobal(pt0, item.parent);
+				pt2 = PointUtils.globalToLocal(pt1, indicatorParent);
+				_dropIndicator.x = pt2.x - 1;
+				_dropIndicator.y = 0;
+			}
+		}
+
+		COMPILE::JS
+		private function displayDropIndicator(item:IUIBase):void
+		{
+			if (dropDirection == "horizontal") {
+				_dropIndicator.x = 0;
+				_dropIndicator.y = item.y;
+			} else {
+				_dropIndicator.x = item.x;
+				_dropIndicator.y = 0;
+			}
+		}
+
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/88cd277a/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/DataGridButtonBarViewForMovableColumns.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/DataGridButtonBarViewForMovableColumns.as b/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/DataGridButtonBarViewForMovableColumns.as
new file mode 100644
index 0000000..abc9b58
--- /dev/null
+++ b/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/DataGridButtonBarViewForMovableColumns.as
@@ -0,0 +1,53 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+	import org.apache.flex.core.IStrand;
+
+	public class DataGridButtonBarViewForMovableColumns extends DragDropListView
+	{
+		/**
+		 * Constructor
+	     *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.8
+		 */
+		public function DataGridButtonBarViewForMovableColumns()
+		{
+			super();
+		}
+
+		private var _strand:IStrand;
+
+		/**
+		 * @private
+		 */
+		override public function set strand(value:IStrand):void
+		{
+			_strand = value;
+			super.strand = value;
+
+			_strand.addBead(new ButtonBarReorderBead());
+			_strand.addBead(new SingleSelectionDragImageBead());
+			_strand.addBead(new SingleSelectionDropIndicatorBead());
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/88cd277a/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/DataGridColumnReorderView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/DataGridColumnReorderView.as b/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/DataGridColumnReorderView.as
new file mode 100644
index 0000000..7d45d7e
--- /dev/null
+++ b/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/DataGridColumnReorderView.as
@@ -0,0 +1,100 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+	import org.apache.flex.core.IStrand;
+ 	import org.apache.flex.core.IBeadModel;
+	import org.apache.flex.core.IDataGridModel;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
+	import org.apache.flex.html.DataGrid;
+
+		/**
+		 *  The DataGridColumnReorderView bead extends DataGridView and
+		 *  lists for changes to the model that is used to produce the column
+		 *  header. When this model changes, this view bead also changes the
+		 *  sub-components to match.
+		 *
+		 *  @viewbead
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public class DataGridColumnReorderView extends DataGridView
+		{
+			/**
+			 *  constructor.
+			 *
+			 *  @langversion 3.0
+			 *  @playerversion Flash 10.2
+			 *  @playerversion AIR 2.6
+			 *  @productversion FlexJS 0.0
+			 */
+			public function DataGridColumnReorderView()
+			{
+				super();
+			}
+
+			private var _strand:IStrand;
+
+
+			/**
+			 *  @copy org.apache.flex.core.IBead#strand
+			 *
+			 *  @langversion 3.0
+			 *  @playerversion Flash 10.2
+			 *  @playerversion AIR 2.6
+			 *  @productversion FlexJS 0.0
+			 */
+			override public function set strand(value:IStrand):void
+			{
+				super.strand = value;
+				_strand = value;
+			}
+
+			/**
+			 * @private
+			 */
+			override protected function finishSetup(event:Event):void
+			{
+				super.finishSetup(event);
+
+				 var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
+				IEventDispatcher(sharedModel).addEventListener("headerModelChanged", handleHeaderModelChanged);
+			}
+
+			/**
+			 * @private
+			 */
+			private function handleHeaderModelChanged(event:Event):void
+			{
+				 trace("** Detected that the DataGrid's header has changed in some way");
+				 var host:DataGrid = _strand as DataGrid;
+				 var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
+
+				 host.removeElement(header);
+				 host.removeElement(listArea);
+
+				 IEventDispatcher(sharedModel).removeEventListener("headerModelChanged", handleHeaderModelChanged);
+				 refreshContent();
+			}
+		}
+}
+

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/88cd277a/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/DragDropListView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/DragDropListView.as b/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/DragDropListView.as
index c900d50..3321775 100644
--- a/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/DragDropListView.as
+++ b/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/DragDropListView.as
@@ -45,9 +45,9 @@ package org.apache.flex.html.beads
 	public class DragDropListView extends ListView
 	{
 		private var _strand:IStrand;
-		
+
 		private var _layer:UIBase;
-		
+
 		/**
 		 * @private
 		 */
@@ -55,32 +55,33 @@ package org.apache.flex.html.beads
 		{
 			_strand = value;
 			super.strand = value;
-			
+
 			var layerBead:ListDrawingLayerBead = new ListDrawingLayerBead();
 			_strand.addBead(layerBead);
 			_layer = layerBead.layer;
-			
-			var chost:IContainer = host as IContainer;
-			chost.strandChildren.addElement(_layer);
-			
+
+			//var chost:IContainer = host as IContainer;
+			//chost.strandChildren.addElement(_layer);
+			UIBase(_strand).addElement(_layer);
+
 			UIBase(_strand).element.style['overflow'] = 'auto';
-			
+
 		}
-		
+
 		/**
 		 * @private
 		 */
 		override public function afterLayout():void
 		{
 			super.afterLayout();
-			
+
 			_layer.x = 0;
 			_layer.y = 0;
 			_layer.width = UIBase(_strand).width;
 			_layer.height = UIBase(_strand).height;
 		}
 	}
-	
+
 	COMPILE::SWF
 	public class DragDropListView extends ListView
 	{
@@ -98,7 +99,7 @@ package org.apache.flex.html.beads
 		}
 
 		private var _strand:IStrand;
-		
+
 		private var _layer:UIBase;
 
 		/**
@@ -108,23 +109,23 @@ package org.apache.flex.html.beads
 		{
 			_strand = value;
 			super.strand = value;
-			
+
 			var layerBead:ListDrawingLayerBead = new ListDrawingLayerBead();
 			_strand.addBead(layerBead);
 			_layer = layerBead.layer;
-			
+
 			var chost:IContainer = host as IContainer;
 			chost.strandChildren.addElement(_layer);
-			
+
 		}
-		
+
 		/**
 		 * @private
 		 */
 		override public function afterLayout():void
 		{
 			super.afterLayout();
-			
+
 			_layer.x = 0;
 			_layer.y = 0;
 			_layer.width = UIBase(_strand).width;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/88cd277a/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/SingleSelectionDragImageBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/SingleSelectionDragImageBead.as b/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/SingleSelectionDragImageBead.as
index d1ff17b..70effee 100644
--- a/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/SingleSelectionDragImageBead.as
+++ b/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/SingleSelectionDragImageBead.as
@@ -26,7 +26,9 @@ package org.apache.flex.html.beads
 	import org.apache.flex.core.IItemRenderer;
 	import org.apache.flex.core.IItemRendererParent;
 	import org.apache.flex.core.IParent;
+	import org.apache.flex.core.ISelectableItemRenderer;
 	import org.apache.flex.core.IStrand;
+	import org.apache.flex.core.IUIBase;
 	import org.apache.flex.core.UIBase;
 	import org.apache.flex.events.DragEvent;
 	import org.apache.flex.events.Event;
@@ -34,22 +36,22 @@ package org.apache.flex.html.beads
 	import org.apache.flex.events.IEventDispatcher;
 	import org.apache.flex.geom.Point;
 	import org.apache.flex.geom.Rectangle;
+	import org.apache.flex.html.Button;
 	import org.apache.flex.html.Group;
 	import org.apache.flex.html.Label;
 	import org.apache.flex.html.beads.controllers.DragMouseController;
-	import org.apache.flex.html.supportClasses.DataItemRenderer;
 	import org.apache.flex.utils.PointUtils;
-	
-    
+
+
 	/**
 	 *  The SingleSelectionDragImageBead produces a UIBase component that represents
 	 *  the item being dragged. It does this by taking the data associcated with the
 	 *  index of the item selected and running the toString() function on it, placing
 	 *  it inside of a Label that is inside of Group (which is given the className of
 	 *  "DragImage").
-	 * 
+	 *
 	 *  The createDragImage() function can be overridden and a different component returned.
-	 * 
+	 *
 	 *  @see org.apache.flex.html.beads.SingleSelectionDragSourceBead.
      *
 	 *  @langversion 3.0
@@ -71,23 +73,23 @@ package org.apache.flex.html.beads
 		{
 			super();
 		}
-		
+
 		private var _strand:IStrand;
-		
+
 		/**
 		 * @private
 		 */
 		public function set strand(value:IStrand):void
 		{
 			_strand = value;
-			
+
 			IEventDispatcher(_strand).addEventListener(DragEvent.DRAG_START, handleDragStart);
 		}
-		
+
 		/**
 		 * Creates an example/temporary component to be dragged and returns it.
-		 * 
-		 * @param ir DataItemRenderer The itemRenderer to be used as a template.
+		 *
+		 * @param ir IItemRenderer The itemRenderer to be used as a template.
 		 * @return UIBase The "dragImage" to use.
 		 *
 		 *  @langversion 3.0
@@ -95,29 +97,33 @@ package org.apache.flex.html.beads
 		 *  @playerversion AIR 2.6
 		 *  @productversion FlexJS 0.8
 		 */
-		protected function createDragImage(ir:DataItemRenderer):UIBase
+		protected function createDragImage(ir:IItemRenderer):UIBase
 		{
 			var dragImage:UIBase = new Group();
 			dragImage.className = "DragImage";
-			dragImage.width = (ir as UIBase).width;
-			dragImage.height = (ir as UIBase).height;
+			dragImage.width = (ir as IUIBase).width;
+			dragImage.height = (ir as IUIBase).height;
+
 			var label:Label = new Label();
-			if (ir.dataField != null) {
-				label.text = ir.data[ir.dataField].toString();
-			} else {
-				label.text = ir.data.toString();
+			if (ir is ISelectableItemRenderer) {
+				var selIR:ISelectableItemRenderer = ir as ISelectableItemRenderer;
+				if (selIR.labelField != null && selIR.data != null) {
+					label.text = selIR.data[selIR.labelField].toString();
+				} else {
+					label.text = selIR.data.toString();
+				}
 			}
-			
+
 			COMPILE::JS {
 				dragImage.element.style.position = 'absolute';
 				dragImage.element.style.cursor = 'pointer';
 			}
-				
+
 			dragImage.addElement(label);
-			
+
 			return dragImage;
 		}
-		
+
 		/**
 		 * @private
 		 */
@@ -126,10 +132,10 @@ package org.apache.flex.html.beads
 			trace("SingleSelectionDragImageBead received the DragStart via: "+event.target.toString());
 
 			var startHere:Object = event.target;
-			
-			if (startHere is DataItemRenderer) {
-				var ir:DataItemRenderer = startHere as DataItemRenderer;
-				DragEvent.dragSource = ir.data;
+
+			if (startHere is IItemRenderer) {
+				var ir:IItemRenderer = startHere as IItemRenderer;
+				//DragEvent.dragSource = ir.data;
 				DragMouseController.dragImage = createDragImage(ir);
 			}
 		}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/88cd277a/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/SingleSelectionDragSourceBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/SingleSelectionDragSourceBead.as b/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/SingleSelectionDragSourceBead.as
index 8b4e1f1..6a2d6f1 100644
--- a/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/SingleSelectionDragSourceBead.as
+++ b/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/SingleSelectionDragSourceBead.as
@@ -26,7 +26,9 @@ package org.apache.flex.html.beads
 	import org.apache.flex.core.IItemRenderer;
 	import org.apache.flex.core.IItemRendererParent;
 	import org.apache.flex.core.IParent;
+	import org.apache.flex.core.IChild;
 	import org.apache.flex.core.IStrand;
+	import org.apache.flex.core.IUIBase;
 	import org.apache.flex.core.UIBase;
 	import org.apache.flex.events.DragEvent;
 	import org.apache.flex.events.Event;
@@ -40,17 +42,17 @@ package org.apache.flex.html.beads
 	import org.apache.flex.html.supportClasses.DataItemRenderer;
 	import org.apache.flex.utils.PointUtils;
 	import org.apache.flex.utils.UIUtils;
-	
-    
+
+
 	/**
 	 *  The SingleSelectionDragSourceBead brings drag capability to single-selection List components.
 	 *  By adding this bead, a user can drag a row of the List to a new location within the list. This bead
 	 *  should be used in conjunction with SingleSelectionDropTargetBead.
-	 * 
+	 *
 	 *  This bead adds a new event to the strand, "dragImageNeeded", which is dispatched on the strand
 	 *  just prior to the dragImage's appearance. An event listener can create its own dragImage if the
 	 *  default, taken from the data item, is not suitable.
-	 * 
+	 *
 	 *  @see org.apache.flex.html.beads.SingleSelectionDropTargetBead.
      *
 	 *  @langversion 3.0
@@ -72,12 +74,12 @@ package org.apache.flex.html.beads
 		{
 			super();
 		}
-		
+
 		private var _strand:IStrand;
 		private var _dragController:DragMouseController;
-		
+
 		private var _dragType:String = "move";
-		
+
 		/**
 		 * The type of drag and drop operation: move or copy.
 	     *
@@ -94,64 +96,63 @@ package org.apache.flex.html.beads
 		{
 			_dragType = value;
 		}
-		
+
 		/**
 		 * @private
 		 */
 		public function set strand(value:IStrand):void
 		{
 			_strand = value;
-			
+
 			_dragController = new DragMouseController();
 			_strand.addBead(_dragController);
-			
+
 			IEventDispatcher(_strand).addEventListener(DragEvent.DRAG_START, handleDragStart);
 			IEventDispatcher(_strand).addEventListener(DragEvent.DRAG_MOVE, handleDragMove);
 			IEventDispatcher(_strand).addEventListener(DragEvent.DRAG_END, handleDragEnd);
 		}
-		
+
 		private var indexOfDragSource:int = -1;
-		
+
 		/**
 		 * @private
 		 */
 		private function handleDragStart(event:DragEvent):void
 		{
 			trace("SingleSelectionDragSourceBead received the DragStart");
-						
+
 			DragEvent.dragInitiator = this;
 			DragMouseController.dragImageOffsetX = 0;
 			DragMouseController.dragImageOffsetY = -30;
-			
+
 			var startHere:Object = event.target;
-			while( !(startHere is DataItemRenderer) && startHere != null) {
-				startHere = startHere.parent;
+			while (!(startHere is IItemRenderer) && startHere != null) {
+				startHere = startHere.itemRendererParent;
 			}
-			
-			if (startHere is DataItemRenderer) {
-				var ir:DataItemRenderer = startHere as DataItemRenderer;
-				
-				var p:UIBase = (ir as UIBase).parent as UIBase;
-				indexOfDragSource = p.getElementIndex(ir);								
+
+			if (startHere is IItemRenderer) {
+				var p:UIBase = startHere.itemRendererParent as UIBase;
+				indexOfDragSource = p.getElementIndex(startHere as IChild);
+				DragEvent.dragSource = (startHere as IItemRenderer).data;
 			}
 		}
-		
+
 		/**
 		 * @private
 		 */
 		protected function handleDragMove(event:DragEvent):void
 		{
 		}
-		
+
 		/**
 		 * @private
 		 */
 		protected function handleDragEnd(event:DragEvent):void
 		{
 		}
-		
+
 		/* IDragInitiator */
-		
+
 		/**
 		 * Handles pre-drop actions.
 	     *
@@ -164,30 +165,30 @@ package org.apache.flex.html.beads
 		{
 			trace("SingleSelectionDragSourceBead accepting drop of type "+type);
 			if (dragType == "copy") return;
-			
+
 			var dataProviderModel:IDataProviderModel = _strand.getBeadByType(IDataProviderModel) as IDataProviderModel;
 			if (dataProviderModel.dataProvider is Array) {
 				var dataArray:Array = dataProviderModel.dataProvider as Array;
-				
+
 				// remove the item being selected
-				dataArray.splice(indexOfDragSource,1);
-				
+				DragEvent.dragSource = dataArray.splice(indexOfDragSource,1)[0];
+
 				// refresh the dataProvider model
 				var newArray:Array = dataArray.slice()
 				dataProviderModel.dataProvider = newArray;
 			}
 			else if (dataProviderModel.dataProvider is ArrayList) {
 				var dataList:ArrayList = dataProviderModel.dataProvider as ArrayList;
-				
+
 				// remove the item being selected
-				dataList.removeItemAt(indexOfDragSource);
-				
+				DragEvent.dragSource = dataList.removeItemAt(indexOfDragSource);
+
 				// refresh the dataProvider model
 				var newList:ArrayList = new ArrayList(dataList.source);
 				dataProviderModel.dataProvider = newList;
 			}
 		}
-		
+
 		/**
 		 * Handles post-drop actions.
 	     *
@@ -201,9 +202,9 @@ package org.apache.flex.html.beads
 			trace("SingleSelectionDragSourceBead accepted drop of type "+type);
 			var value:Object = DragEvent.dragSource;
 			trace(" -- index: "+indexOfDragSource+" of data: "+value.toString());
-			
+
 			indexOfDragSource = -1;
 		}
-		
+
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/88cd277a/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/SingleSelectionDropTargetBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/SingleSelectionDropTargetBead.as b/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/SingleSelectionDropTargetBead.as
index ee93eca..c4facda 100644
--- a/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/SingleSelectionDropTargetBead.as
+++ b/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/SingleSelectionDropTargetBead.as
@@ -21,12 +21,14 @@ package org.apache.flex.html.beads
 	import org.apache.flex.collections.ArrayList;
 	import org.apache.flex.core.DropType;
 	import org.apache.flex.core.IBead;
+	import org.apache.flex.core.IChild;
 	import org.apache.flex.core.IDataProviderModel;
 	import org.apache.flex.core.IItemRenderer;
 	import org.apache.flex.core.IParent;
 	import org.apache.flex.core.IStrand;
 	import org.apache.flex.core.IUIBase;
 	import org.apache.flex.core.UIBase;
+	import org.apache.flex.events.Event;
 	import org.apache.flex.events.DragEvent;
 	import org.apache.flex.events.EventDispatcher;
 	import org.apache.flex.events.IEventDispatcher;
@@ -36,13 +38,13 @@ package org.apache.flex.html.beads
 	import org.apache.flex.html.supportClasses.DataItemRenderer;
 	import org.apache.flex.utils.PointUtils;
 	import org.apache.flex.utils.UIUtils;
-	
-    
+
+
 	/**
 	 *  The SingleSelectionDropTargetBead enables items to be dropped onto single-selection List
 	 *  components. This bead can be used with SingleSelectionDragSourceBead to enable the re-arrangement
 	 *  of rows within the same list.
-     *  
+     *
 	 *  @see org.apache.flex.html.beads.SingleSelectionDropIndicatorBead
      *
 	 *  @langversion 3.0
@@ -64,33 +66,44 @@ package org.apache.flex.html.beads
 		{
 			super();
 		}
-		
+
 		private var _dropController:DropMouseController;
 		private var _dropIndicatorBead:SingleSelectionDropIndicatorBead;
 		private var _dropIndicator:UIBase;
 		private var lastItemVisited:Object;
 		private var indicatorVisible:Boolean = false;
-		
+
 		private var _strand:IStrand;
-		
+
 		/**
 		 * @private
 		 */
 		public function set strand(value:IStrand):void
 		{
 			_strand = value;
-			
+
 			_dropController = new DropMouseController();
 			_strand.addBead(_dropController);
-			
+
 			IEventDispatcher(_dropController).addEventListener(DragEvent.DRAG_ENTER, handleDragEnter);
 			IEventDispatcher(_dropController).addEventListener(DragEvent.DRAG_EXIT, handleDragExit);
 			IEventDispatcher(_dropController).addEventListener(DragEvent.DRAG_OVER, handleDragOver);
 			IEventDispatcher(_dropController).addEventListener(DragEvent.DRAG_DROP, handleDragDrop);
 		}
-		
+
+		private var _dropDirection: String = "horizontal";
+
+		public function get dropDirection():String
+		{
+			return _dropDirection;
+		}
+		public function set dropDirection(value:String):void
+		{
+			_dropDirection = value;
+		}
+
 		protected var _indicatorParent:UIBase;
-		
+
 		protected function get indicatorParent():UIBase
 		{
 			if (_indicatorParent == null) {
@@ -101,7 +114,7 @@ package org.apache.flex.html.beads
 			}
 			return _indicatorParent;
 		}
-		
+
 		/**
 		 * @private
 		 */
@@ -114,7 +127,7 @@ package org.apache.flex.html.beads
 			_dropIndicator = _dropIndicatorBead.getDropIndicator(ir, width, height);
 			return _dropIndicator;
 		}
-		
+
 		/**
 		 * @private
 		 */
@@ -124,48 +137,39 @@ package org.apache.flex.html.beads
 			var pt0:Point;
 			var pt1:Point;
 			var pt2:Point;
-			
+
 			_dropController.acceptDragDrop(event.target as IUIBase, DropType.COPY);
-			
+
 			var startHere:Object = event.relatedObject;
-			while( !(startHere is DataItemRenderer) && startHere != null) {
+			while( !(startHere is IItemRenderer) && startHere != null) {
 				startHere = startHere.parent;
 			}
-			
-			if (startHere is DataItemRenderer) {
-				var ir:DataItemRenderer = startHere as DataItemRenderer;				
+
+			if (startHere is IItemRenderer) {
+				var ir:IItemRenderer = startHere as IItemRenderer;
 				lastItemVisited = ir;
 			}
-			
+
 			if (lastItemVisited && !indicatorVisible && indicatorParent) {
-				var di:UIBase = getDropIndicator(lastItemVisited, indicatorParent.width, 4);
+				var di:UIBase = getDropIndicator(lastItemVisited, (dropDirection == "horizontal") ? indicatorParent.width : 4,
+					                             (dropDirection == "horizontal") ? 4 : indicatorParent.height);
 				indicatorVisible = true;
-				COMPILE::SWF {
-					pt0 = new Point(0, (lastItemVisited as UIBase).y);
-					pt1 = PointUtils.localToGlobal(pt0, lastItemVisited.parent ? lastItemVisited.parent : _strand);
-					pt2 = PointUtils.globalToLocal(pt1, indicatorParent);
-					di.x = 0;
-					di.y = pt2.y;
-				}
-				COMPILE::JS {
-					di.x = 0;
-					di.y = (lastItemVisited as UIBase).y;
-				}
-								
+				displayDropIndicator(lastItemVisited as IUIBase);
+
 				if (indicatorParent != null) {
 					indicatorParent.addElement(di);
 				}
 			}
-			
+
 		}
-		
+
 		/**
 		 * @private
 		 */
 		private function handleDragExit(event:DragEvent):void
 		{
 			trace("SingleSelectionDropTargetBead received DragExit via: "+event.relatedObject.toString());
-			
+
 			if (indicatorVisible) {
 				if (indicatorParent != null) {
 					indicatorParent.removeElement(_dropIndicator);
@@ -173,7 +177,7 @@ package org.apache.flex.html.beads
 				indicatorVisible = false;
 			}
 		}
-		
+
 		/**
 		 * @private
 		 */
@@ -183,83 +187,65 @@ package org.apache.flex.html.beads
 			var pt0:Point;
 			var pt1:Point;
 			var pt2:Point;
-			
+
 			var startHere:Object = event.relatedObject;
-			while( !(startHere is DataItemRenderer) && startHere != null) {
+			while( !(startHere is IItemRenderer) && startHere != null) {
 				startHere = startHere.parent;
 			}
-			
-			if ((startHere is DataItemRenderer) && _dropIndicator != null && indicatorParent) {
-				COMPILE::SWF {
-					pt0 = new Point(0, (startHere as UIBase).y);
-					pt1 = PointUtils.localToGlobal(pt0, startHere.parent);
-					pt2 = PointUtils.globalToLocal(pt1, indicatorParent);
-					_dropIndicator.x = 0;
-					_dropIndicator.y = pt2.y - 1;
-				}
-				COMPILE::JS {
-					_dropIndicator.x = 0;
-					_dropIndicator.y = (startHere as UIBase).y;
-				}
-				
+
+			if ((startHere is IItemRenderer) && _dropIndicator != null && indicatorParent) {
+				displayDropIndicator(startHere as IUIBase);
 				lastItemVisited = startHere;
-				
-			} 
+
+			}
 			else if (lastItemVisited && _dropIndicator != null && indicatorParent) {
 				var lastItem:UIBase = lastItemVisited as UIBase;
-				COMPILE::SWF {
-					pt0 = new Point(0, lastItem.y);
-					pt1 = PointUtils.localToGlobal(pt0, lastItem.parent);
-					pt2 = PointUtils.globalToLocal(pt1, indicatorParent);
-					_dropIndicator.x = 0;
-					_dropIndicator.y = pt2.y + lastItem.height + 1;
-				}
-				COMPILE::JS {
-					_dropIndicator.x = 0;
-					_dropIndicator.y = lastItem.y;
-				}
+				displayDropIndicator(lastItemVisited as IUIBase);
 			}
 		}
-		
+
 		/**
 		 * @private
 		 */
 		private function handleDragDrop(event:DragEvent):void
 		{
 			trace("SingleSelectionDropTargetBead received DragDrop via: "+event.relatedObject.toString());
-			
+
 			handleDragExit(event);
-						
+
 			var targetIndex:int = -1; // indicates drop beyond length of items
-			
+			var itemRendererParent:UIBase;
+
 			var startHere:Object = event.relatedObject;
 			while( !(startHere is IItemRenderer) && startHere != null) {
 				startHere = startHere.parent;
 			}
-			
+
 			if (startHere is IItemRenderer) {
 				var ir:IItemRenderer = startHere as IItemRenderer;
 				trace("-- dropping onto an existing object: "+ir.data.toString());
-				
-				var p:UIBase = (ir as UIBase).parent as UIBase;
-				targetIndex = p.getElementIndex(ir);
+
+				itemRendererParent = ir.itemRendererParent as UIBase;
+				targetIndex = itemRendererParent.getElementIndex(ir);
 			}
 			else  {
+				itemRendererParent = startHere.itemRendererParent as UIBase;
 				trace("-- dropping after the last item");
 			}
-			
-			var downPoint:Point = new Point(event.clientX, event.clientY); 
+
+			var downPoint:Point = new Point(event.clientX, event.clientY);
 			//trace("Dropping at this point: "+downPoint.x+", "+downPoint.y);
 			//trace("-- find the itemRenderer this object is over");
-						
+
 			// Let the dragInitiator know that the drop was accepted so it can do
 			// whatever it needs to do to prepare the data or structures.
 			if (DragEvent.dragInitiator) {
 				DragEvent.dragInitiator.acceptingDrop(_strand, "object");
 			}
-				
+
 			var dragSource:Object = DragEvent.dragSource;
-				
+			var sourceIndex:int = 0;
+
 			var dataProviderModel:IDataProviderModel = _strand.getBeadByType(IDataProviderModel) as IDataProviderModel;
 			if (dataProviderModel.dataProvider is Array) {
 				var dataArray:Array = dataProviderModel.dataProvider as Array;
@@ -272,13 +258,13 @@ package org.apache.flex.html.beads
 					// insert before targetIndex
 					dataArray.splice(targetIndex, 0, dragSource);
 				}
-				
+
 				var newArray:Array = dataArray.slice()
 				dataProviderModel.dataProvider = newArray;
 			}
 			else if (dataProviderModel.dataProvider is ArrayList) {
 				var dataList:ArrayList = dataProviderModel.dataProvider as ArrayList;
-				
+
 				// insert the item being dropped
 				if (targetIndex == -1) {
 					// sppend to the end
@@ -287,15 +273,52 @@ package org.apache.flex.html.beads
 					// insert before target index
 					dataList.addItemAt(dragSource, targetIndex);
 				}
-				
+
 				var newList:ArrayList = new ArrayList(dataList.source);
 				dataProviderModel.dataProvider = newList;
 			}
-				
+
 			// Let the dragInitiator know the drop has been completed.
 			if (DragEvent.dragInitiator) {
 				DragEvent.dragInitiator.acceptedDrop(_strand, "object");
 			}
+
+			IEventDispatcher(_strand).dispatchEvent(new Event("dragDropAccepted"));
+		}
+
+		COMPILE::SWF
+		private function displayDropIndicator(item:IUIBase):void
+		{
+			var pt0:Point;
+			var pt1:Point;
+			var pt2:Point;
+
+			if (dropDirection == "horizontal") {
+				pt0 = new Point(0, item.y);
+				pt1 = PointUtils.localToGlobal(pt0, item.parent);
+				pt2 = PointUtils.globalToLocal(pt1, indicatorParent);
+				_dropIndicator.x = 0;
+				_dropIndicator.y = pt2.y - 1;
+			}
+			else {
+				pt0 = new Point(item.x, 0);
+				pt1 = PointUtils.localToGlobal(pt0, item.parent);
+				pt2 = PointUtils.globalToLocal(pt1, indicatorParent);
+				_dropIndicator.x = pt2.x - 1;
+				_dropIndicator.y = 0;
+			}
+		}
+
+		COMPILE::JS
+		private function displayDropIndicator(item:IUIBase):void
+		{
+			if (dropDirection == "horizontal") {
+				_dropIndicator.x = 0;
+				_dropIndicator.y = item.y;
+			} else {
+				_dropIndicator.x = item.x;
+				_dropIndicator.y = 0;
+			}
 		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/88cd277a/frameworks/projects/DragDrop/src/main/resources/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/DragDrop/src/main/resources/basic-manifest.xml b/frameworks/projects/DragDrop/src/main/resources/basic-manifest.xml
index 68804ac..75f426a 100644
--- a/frameworks/projects/DragDrop/src/main/resources/basic-manifest.xml
+++ b/frameworks/projects/DragDrop/src/main/resources/basic-manifest.xml
@@ -33,4 +33,8 @@
 	<component id="DragDropListView" class="org.apache.flex.html.beads.DragDropListView" />
 	<component id="ListDrawingLayerBead" class="org.apache.flex.html.beads.ListDrawingLayerBead" />
 	
+	<component id="DataGridButtonBarViewForMovableColumns" class="org.apache.flex.html.beads.DataGridButtonBarViewForMovableColumns" />
+	<component id="DataGridColumnReorderView" class="org.apache.flex.html.beads.DataGridColumnReorderView" />
+	<component id="ButtonBarReorderBead" class="org.apache.flex.html.beads.ButtonBarReorderBead" />
+	
 </componentPackage>


Mime
View raw message