You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by pe...@apache.org on 2018/01/16 21:13:30 UTC

[royale-asjs] branch develop updated: Updated TreeExample to use TreeGrid.

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

pent 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 5d5e2b5  Updated TreeExample to use TreeGrid.
5d5e2b5 is described below

commit 5d5e2b53a433b753b06a214191ee7b86ba91fd8c
Author: Peter Ent <pe...@apache.org>
AuthorDate: Tue Jan 16 16:15:20 2018 -0500

    Updated TreeExample to use TreeGrid.
---
 .../TreeExample/src/main/royale/MyInitialView.mxml | 15 ++++++++
 .../TreeExample/src/main/royale/models/MyModel.as  | 40 +++++++++++-----------
 2 files changed, 35 insertions(+), 20 deletions(-)

diff --git a/examples/royale/TreeExample/src/main/royale/MyInitialView.mxml b/examples/royale/TreeExample/src/main/royale/MyInitialView.mxml
index 1f1b923..61bdbc0 100644
--- a/examples/royale/TreeExample/src/main/royale/MyInitialView.mxml
+++ b/examples/royale/TreeExample/src/main/royale/MyInitialView.mxml
@@ -23,6 +23,7 @@ limitations under the License.
 	<fx:Style>
 		@namespace js "library://ns.apache.org/royale/basic";
 		
+		
 	</fx:Style>
 	
 	<fx:Script>
@@ -43,5 +44,19 @@ limitations under the License.
 				destinationPropertyName="dataProvider" />
 		</js:beads>
 	</js:Tree>
+	
+	<js:TreeGrid x="450" y="30" width="500" height="500" rowHeight="40">
+		<js:beads>
+			<js:ConstantBinding
+				sourceID="applicationModel"
+				sourcePropertyName="treeData"
+				destinationPropertyName="dataProvider" />
+		</js:beads>
+		<js:columns>
+			<js:TreeGridColumn label="Title" dataField="title" columnWidth="250"  />
+			<js:DataGridColumn label="Artist" dataField="artist" columnWidth="150" />
+			<js:DataGridColumn label="Length" dataField="length" columnWidth="100" />
+		</js:columns>
+	</js:TreeGrid>
 
 </js:View>
diff --git a/examples/royale/TreeExample/src/main/royale/models/MyModel.as b/examples/royale/TreeExample/src/main/royale/models/MyModel.as
index c23b394..ed6c124 100644
--- a/examples/royale/TreeExample/src/main/royale/models/MyModel.as
+++ b/examples/royale/TreeExample/src/main/royale/models/MyModel.as
@@ -37,36 +37,36 @@ package models
 
 		private var store:Object = { title:"That's Entertainment",
         		children:[
-        			{title:"My Music",
+        			{title:"My Music", artist:"", length:"",
         				children:[
-        					{title:"Language and Perspective", artist:"Bad Suns",
+        					{title:"Language and Perspective", artist:"Bad Suns", length:"31:47",
         					    children:[
-        					    	{title:"Matthew James", length:"3:24"},
-        					    	{title:"We Move Like the Ocean", length:"3:56"},
-        					    	{title:"Cardiac Arrest", length:"3:15"}
+        					    	{title:"Matthew James", artist:"Bad Suns (feat BS)", length:"3:24"},
+        					    	{title:"We Move Like the Ocean", artist:"Bad Suns", length:"3:56"},
+        					    	{title:"Cardiac Arrest", artist:"Bad Suns", length:"3:15"}
         					    ]},
-        					{title:"Strange Desire", artist:"Bleachers",
+        					{title:"Strange Desire", artist:"Bleachers", length:"28:56",
         						children:[
-        							{title:"Wild Heart", length:"4:15"},
-        							{title:"Rollercoaster", length:"3:39"},
-        							{title:"Shadow", length:"3:46"},
-        							{title:"I Wanna Get Better", length:"4:23"}
+        							{title:"Wild Heart", artist:"Bleachers", length:"4:15"},
+        							{title:"Rollercoaster", artist:"Bleachers", length:"3:39"},
+        							{title:"Shadow", artist:"Bleachers", length:"3:46"},
+        							{title:"I Wanna Get Better", artist:"Bleachers", length:"4:23"}
         						]}
         				]},
-        			{title:"My Books",
+        			{title:"My Books", artist:"", length:"",
         				children:[
-        					{title:"Wizard of Oz",
+        					{title:"Wizard of Oz", artist:"Frank L Baum", length: "1024",
         						children:[
-        							{title:"So this is Kansas?", length:"82"},
-        							{title:"A Might Dusty Here", length:"63"},
-        							{title:"Is that a Tornado?", length:"103"}
+        							{title:"So this is Kansas?", artist:"Frank L Baum", length:"82"},
+        							{title:"A Might Dusty Here", artist:"Frank L Baum", length:"63"},
+        							{title:"Is that a Tornado?", artist:"Frank L Baum", length:"103"}
         						]},
-        					{title:"Favorite Book #2",
+        					{title:"Favorite Book #2", artist: "The Writer", length: "4095",
         						children:[
-        							{title:"Chapter 1", length:"15"},
-        							{title:"Chapter 2", length:"86"},
-        							{title:"Chapter 3", length:"104"},
-        							{title:"Chapter 4", length:"99"}
+        							{title:"Chapter 1", artist: "The Writer", length:"15"},
+        							{title:"Chapter 2", artist: "The Writer", length:"86"},
+        							{title:"Chapter 3", artist: "The Writer", length:"104"},
+        							{title:"Chapter 4", artist: "The Writer", length:"99"}
         						]}
         				]}
         		]};

-- 
To stop receiving notification emails like this one, please contact
['"commits@royale.apache.org" <co...@royale.apache.org>'].