You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by gr...@apache.org on 2021/12/16 05:10:49 UTC

[royale-asjs] branch develop updated: upgrade Array to ArrayCollection in mx dataProvider setter.

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

gregdove 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 a1cb1a9  upgrade Array to ArrayCollection in mx dataProvider setter.
a1cb1a9 is described below

commit a1cb1a90579dd3fa558bb12152da098d809a0cba
Author: greg-dove <gr...@gmail.com>
AuthorDate: Thu Dec 16 18:10:36 2021 +1300

    upgrade Array to ArrayCollection in mx dataProvider setter.
---
 .../src/main/royale/mx/controls/listClasses/DataGridListBase.as    | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/DataGridListBase.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/DataGridListBase.as
index 79696e7..97c89b4 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/DataGridListBase.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/DataGridListBase.as
@@ -36,7 +36,7 @@ import flash.utils.Dictionary;
 import flash.utils.clearInterval;
 import flash.utils.setInterval;
 
-import mx.collections.ArrayCollection;
+
 */
 COMPILE::SWF{
     import flash.display.DisplayObject;
@@ -51,6 +51,7 @@ import mx.collections.ICollectionView;
 import mx.collections.IViewCursor;
 import mx.collections.Sort;
 import mx.collections.SortField;
+import mx.collections.ArrayCollection;
 import mx.controls.beads.DataGridView;
 import mx.controls.beads.layouts.DataGridLayout;
 import mx.controls.dataGridClasses.DataGridColumn;
@@ -582,16 +583,18 @@ public class DataGridListBase extends ListBase /* extends UIComponent
 
     /**
      *  @private
+     *  @royaleignorecoercion Array
      */
     override public function set dataProvider(value:Object):void
     {
         if (collection)
             collection.removeEventListener(CollectionEvent.COLLECTION_CHANGE, collectionChangeHandler);
 
+        if (value is Array) value = new ArrayCollection(value as Array);
         collection = value as ICollectionView;
         if (collection)
 		{
-        		collection.addEventListener(CollectionEvent.COLLECTION_CHANGE, collectionChangeHandler);
+        	collection.addEventListener(CollectionEvent.COLLECTION_CHANGE, collectionChangeHandler);
 	        iterator = collection.createCursor();
 	        collectionIterator = collection.createCursor(); //IViewCursor(collection);
 		}