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

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

commit 23f0bf19db7f7faaf518a1a123eab82d037a4435
Author: Alex Harui <aha...@apache.org>
AuthorDate: Tue Feb 13 17:09:42 2018 -0800

    example for fixed row height virtual lists
---
 .../ListExample/src/main/royale/MyInitialView.mxml  | 21 ++++++++++++++++++++-
 .../src/main/royale/models/ProductsModel.as         | 15 +++++++++++++++
 2 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/examples/royale/ListExample/src/main/royale/MyInitialView.mxml 
b/examples/royale/ListExample/src/main/royale/MyInitialView.mxml
index 2a97d31..abcbd33 100644
--- a/examples/royale/ListExample/src/main/royale/MyInitialView.mxml
+++ b/examples/royale/ListExample/src/main/royale/MyInitialView.mxml
@@ -115,5 +115,24 @@ limitations under the License.
        </gen:GenericList>
        
        <js:TextButton text="Add Wing Bats" x="580" y="350" 
click="addProduct()" />
-       
+
+    <!-- A virtual list
+    -->
+    
+    <js:Label x="880" y="20" text="A virtual List" />
+    
+    <js:List x="880" y="40" width="200" height="300" >
+        <js:beads>
+            <js:ConstantBinding
+                sourceID="applicationModel"
+                sourcePropertyName="bigArray"
+                destinationPropertyName="dataProvider" />
+            <!-- you also add this itemRendererFactory if your DataContainer 
list
+            is using an ArrayList as its dataProvider -->
+            <js:VirtualDataItemRendererFactoryForArrayData />
+            <js:VirtualListVerticalLayout />
+        </js:beads>
+    </js:List>
+    
+
 </js:View>
diff --git 
a/examples/royale/ListExample/src/main/royale/models/ProductsModel.as 
b/examples/royale/ListExample/src/main/royale/models/ProductsModel.as
index 7ae33ca..f4601eb 100644
--- a/examples/royale/ListExample/src/main/royale/models/ProductsModel.as
+++ b/examples/royale/ListExample/src/main/royale/models/ProductsModel.as
@@ -40,5 +40,20 @@ package models
                {
                        return _states;
                }
+        
+        public var _bigArray:Array;
+        
+        public function get bigArray():Array
+        {
+            if (!_bigArray)
+            {
+                _bigArray = [];
+                for (var i:int = 0; i < 1000; i++)
+                {
+                    _bigArray.push("row " + i.toString());
+                }
+            }
+            return _bigArray;
+        }
        }
 }

-- 
To stop receiving notification emails like this one, please contact
aha...@apache.org.

Reply via email to