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

piotrz 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 dc3af38  MXRoyale: Add DataGrid example where component is being 
created trough code
dc3af38 is described below

commit dc3af389c2ccd793df7a96800ab6a3a72b055805
Author: Piotr Zarzycki <[email protected]>
AuthorDate: Thu Jan 13 17:24:16 2022 +0100

    MXRoyale: Add DataGrid example where component is being created trough code
---
 .../DataGridInlineExample.as3proj                  | 123 ++++++++++++++++
 examples/mxroyale/DataGridInlineExample/build.xml  |  68 +++++++++
 examples/mxroyale/DataGridInlineExample/pom.xml    | 155 +++++++++++++++++++++
 .../src/main/royale/DataGridInlineExample.mxml     |  96 +++++++++++++
 .../src/main/royale/models/ProductsModel.as        |  62 +++++++++
 .../src/main/royale/products/Product.as            |  89 ++++++++++++
 .../main/royale/products/addRandomADGColumns.as    |  50 +++++++
 .../src/main/royale/products/addRandomDGColumns.as |  51 +++++++
 .../main/royale/products/addRandomProductValues.as |  36 +++++
 9 files changed, 730 insertions(+)

diff --git 
a/examples/mxroyale/DataGridInlineExample/DataGridInlineExample.as3proj 
b/examples/mxroyale/DataGridInlineExample/DataGridInlineExample.as3proj
new file mode 100644
index 0000000..6323d9b
--- /dev/null
+++ b/examples/mxroyale/DataGridInlineExample/DataGridInlineExample.as3proj
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<project>
+  <output>
+    <movie version="20"/>
+    <movie disabled="False"/>
+    <movie platform="Flash Player"/>
+    <movie background="#FFFFFF"/>
+    <movie height="600"/>
+    <movie fps="60"/>
+    <movie path="bin-debug/DataGridInlineExample.swf"/>
+    <movie input=""/>
+    <movie width="800"/>
+  </output>
+  &lt;!-- Other classes to be compiled into your SWF --&gt;
+  <jsOutput>
+    <option path=""/>
+  </jsOutput>
+  <classpaths>
+    <class path="src/main/royale"/>
+  </classpaths>
+  <moonshineResourcePaths></moonshineResourcePaths>
+  <moonshineNativeExtensionPaths></moonshineNativeExtensionPaths>
+  <build>
+    <option showUnusedTypeSelectorWarnings="True"/>
+    <option linkReport=""/>
+    <option showActionScriptWarnings="True"/>
+    <option showDeprecationWarnings="True"/>
+    <option additional="+configname=flex"/>
+    <option optimize="False"/>
+    <option antBuildPath="build/build.xml"/>
+    <option useNetwork="True"/>
+    <option sourceMap="False"/>
+    <option loadConfig=""/>
+    <option useResourceBundleMetadata="True"/>
+    <option locale=""/>
+    <option compilerConstants=""/>
+    <option es="False"/>
+    <option warnings="True"/>
+    <option showBindingWarnings="True"/>
+    <option strict="True"/>
+    <option allowSourcePathOverlap="False"/>
+    <option verboseStackTraces="False"/>
+    <option accessible="False"/>
+    <option customSDK=""/>
+    <option benchmark="False"/>
+    <option staticLinkRSL="False"/>
+  </build>
+  <mavenBuild>
+    <option dominoNotesProgram=""/>
+    <option commandLine=""/>
+    <option settingsFilePath=""/>
+    <option dominoNotesPlatform=""/>
+    <option mavenBuildPath=""/>
+    <actions>
+      <action actionName="Build" action="install"/>
+      <action actionName="Clean and package" action="clean package"/>
+      <action actionName="Clean" action="clean"/>
+      <action actionName="Clean and Build" action="clean install"/>
+      <action actionName="Exploded" action="war:exploded"/>
+    </actions>
+  </mavenBuild>
+  <includeLibraries></includeLibraries>
+  <libraryPaths></libraryPaths>
+  <externalLibraryPaths></externalLibraryPaths>
+  <rslPaths></rslPaths>
+  <intrinsics>
+    <element path="Library/AS3/frameworks/Flex4"/>
+    <element path="Library\AS3\frameworks\Flex4"/>
+  </intrinsics>
+  <library></library>
+  <modules/>
+  <compileTargets>
+    <compile path="src/main/royale/DataGridInlineExample.mxml"/>
+  </compileTargets>
+  <hiddenPaths></hiddenPaths>
+  <preBuildCommand>null</preBuildCommand>
+  <postBuildCommand alwaysRun="False">null</postBuildCommand>
+  <trustSVNCertificate>False</trustSVNCertificate>
+  <options>
+    <option visualEditorExportPath=""/>
+    <option testMovieCommand=""/>
+    <option testMovie=""/>
+    <option showHiddenPaths="False"/>
+    <option isDominoVisualEditor="False"/>
+    <option isPrimeFacesVisualEditor="False"/>
+    <option isRoyale="True"/>
+    <option isExportedToExistingSource="False"/>
+    <option defaultBuildTargets=""/>
+    <option jdkType="default-java"/>
+  </options>
+  <moonshineRunCustomization>
+    <option deviceSimulator="null"/>
+    <option urlToLaunch=""/>
+    <option targetPlatform="5"/>
+    <option webBrowser="null"/>
+    <option projectType="2"/>
+    <option customUrlToLaunch=""/>
+    <option deviceConnectType="USB"/>
+    <option launchMethod="Simulator"/>
+    <deviceSimulator>null</deviceSimulator>
+    <certAndroid>null</certAndroid>
+    <certIos>null</certIos>
+    <certIosProvisioning>null</certIosProvisioning>
+  </moonshineRunCustomization>
+</project>
diff --git a/examples/mxroyale/DataGridInlineExample/build.xml 
b/examples/mxroyale/DataGridInlineExample/build.xml
new file mode 100644
index 0000000..cd7650c
--- /dev/null
+++ b/examples/mxroyale/DataGridInlineExample/build.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+<!--
+
+  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.
+
+-->
+
+
+<project name="DataGridExample" default="main" basedir=".">
+    <property name="ROYALE_HOME" location="../../.."/>
+    <property name="example" value="DataGridExample" />
+    
+    <property file="${ROYALE_HOME}/env.properties"/>
+    <property environment="env"/>
+    <property file="${ROYALE_HOME}/build.properties"/>
+    <property name="ROYALE_HOME" value="${ROYALE_HOME}"/>
+    <property name="config_arg" value="flex"/>
+
+    <include file="${basedir}/../../build_example.xml" />
+    
+    <target name="main" depends="clean,build_example.compile" 
description="Clean build of ${example}">
+       <property name="theme_arg" 
value="–theme=frameworks/themes/MXRoyale/src/mx.css" />
+       <mkdir dir="${basedir}/bin/js-debug/assets" />
+        <copy todir="${basedir}/bin/js-debug/assets" >
+            <fileset dir="${basedir}/src/main/resources/assets">
+                <include name="**" />
+            </fileset>
+        </copy>
+        <mkdir dir="${basedir}/bin/js-release/assets" />
+        <copy todir="${basedir}/bin/js-release/assets" >
+            <fileset dir="${basedir}/src/main/resources/assets">
+                <include name="**" />
+            </fileset>
+        </copy>
+    </target>
+    
+    <target name="clean">
+        <delete dir="${basedir}/bin" failonerror="false" />
+        <delete dir="${basedir}/bin-debug" failonerror="false" />
+        <delete dir="${basedir}/bin-release" failonerror="false" />
+        <delete dir="${basedir}/target" failonerror="false" />
+    </target>
+
+    <target name="examine" depends="build_example.get.browser">
+        <property name="which" value="debug" />
+        <echo message="Make sure label appears."/>
+        <exec executable="${browser}" dir="${basedir}/bin-${which}" 
failonerror="true">
+            <arg value="${basedir}/bin-${which}/${example}.html"/>
+        </exec>
+        <exec executable="${browser}" dir="${basedir}/bin/js-${which}" 
failonerror="true">
+            <arg value="${basedir}/bin/js-${which}/index.html"/>
+        </exec>
+    </target>
+
+</project>
diff --git a/examples/mxroyale/DataGridInlineExample/pom.xml 
b/examples/mxroyale/DataGridInlineExample/pom.xml
new file mode 100644
index 0000000..fb97586
--- /dev/null
+++ b/examples/mxroyale/DataGridInlineExample/pom.xml
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+  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.
+
+--><project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.royale.examples</groupId>
+    <artifactId>examples-mxroyale</artifactId>
+    <version>0.9.9-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>DataGridExample-MXRoyale</artifactId>
+  <version>0.9.9-SNAPSHOT</version>
+  <packaging>swf</packaging>
+
+  <name>Apache Royale: Examples: MXRoyale: DataGridInlineExample</name>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.royale.compiler</groupId>
+        <artifactId>royale-maven-plugin</artifactId>
+        <extensions>true</extensions>
+        <configuration>
+          <mainClass>DataGridInlineExample.mxml</mainClass>
+          <allowSubclassOverrides>true</allowSubclassOverrides>
+          <targets>${royale.targets}</targets>
+          <debug>false</debug>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.royale.framework</groupId>
+      <artifactId>BasicTheme</artifactId>
+      <version>0.9.9-SNAPSHOT</version>
+      <type>swc</type>
+      <scope>theme</scope>
+      <classifier>js</classifier>
+    </dependency>
+  </dependencies>
+
+
+  <profiles>
+    <profile>
+      <id>option-with-swf</id>
+      <properties>
+        <title>${project.artifactId}</title>
+        <bgcolor>#ffffff</bgcolor>
+        <useBrowserHistory>--</useBrowserHistory>
+        <version_major>11</version_major>
+        <version_minor>5</version_minor>
+        <version_revision>0</version_revision>
+        <expressInstallSwf>expressInstall.swf</expressInstallSwf>
+        <application>${project.artifactId}</application>
+        <swf>${project.artifactId}-${project.version}</swf>
+        <width>100%</width>
+        <height>100%</height>
+      </properties>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.royale.compiler</groupId>
+            <artifactId>royale-maven-plugin</artifactId>
+            <extensions>true</extensions>
+            <configuration>
+              <mainClass>DataGridExample.mxml</mainClass>
+              <allowSubclassOverrides>true</allowSubclassOverrides>
+              <targets>${royale.targets}</targets>
+              <debug>false</debug>
+            </configuration>
+          </plugin>
+          <plugin>
+            <artifactId>maven-resources-plugin</artifactId>
+            <version>3.1.0</version>
+            <executions>
+              <execution>
+                <id>copy-template-swf</id>
+                <phase>compile</phase>
+                <goals>
+                  <goal>copy-resources</goal>
+                </goals>
+                <configuration>
+                  <outputDirectory>${basedir}/target</outputDirectory>
+                  <includeEmptyDirs>true</includeEmptyDirs>
+                  <resources>
+                    <resource>
+                      
<directory>${basedir}/../../../templates/swfobject</directory>
+                      <filtering>true</filtering>
+                    </resource>
+                  </resources>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>com.coderplus.maven.plugins</groupId>
+            <artifactId>copy-rename-maven-plugin</artifactId>
+            <version>1.0.1</version>
+            <executions>
+              <execution>
+                <id>rename-file</id>
+                <phase>compile</phase>
+                <goals>
+                  <goal>rename</goal>
+                </goals>
+                <configuration>
+                  
<sourceFile>${basedir}/target/index.template.html</sourceFile>
+                  
<destinationFile>${basedir}/target/${project.artifactId}.html</destinationFile>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+      <dependencies>
+        <dependency>
+          <groupId>org.apache.royale.framework</groupId>
+          <artifactId>BasicTheme</artifactId>
+          <version>0.9.9-SNAPSHOT</version>
+          <type>swc</type>
+          <scope>theme</scope>
+          <classifier>swf</classifier>
+        </dependency>
+        <dependency>
+          <groupId>org.apache.royale.framework</groupId>
+          <artifactId>BasicTheme</artifactId>
+          <version>0.9.9-SNAPSHOT</version>
+          <type>swc</type>
+          <scope>theme</scope>
+          <classifier>js</classifier>
+        </dependency>
+      </dependencies>
+    </profile>
+  </profiles>
+
+<properties /></project>
diff --git 
a/examples/mxroyale/DataGridInlineExample/src/main/royale/DataGridInlineExample.mxml
 
b/examples/mxroyale/DataGridInlineExample/src/main/royale/DataGridInlineExample.mxml
new file mode 100644
index 0000000..2d601c1
--- /dev/null
+++ 
b/examples/mxroyale/DataGridInlineExample/src/main/royale/DataGridInlineExample.mxml
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
+                   xmlns:mx="library://ns.apache.org/royale/mx"
+                                  xmlns:prod="products.*"
+                   width="100%" height="800"
+                                  creationComplete="onInitialize()"
+                   layout="vertical" >
+       <!-- to do: layout="absolute" minWidth="955" minHeight="600" -->
+       <fx:Style>
+               @namespace "library://ns.apache.org/royale/mx";
+
+
+               Application {
+                       horizontalGap: 50px;
+               }
+
+
+               .outline{
+                       border-width: 1px;
+                       border-style: solid;
+                       border-color: black;
+               }
+
+
+       </fx:Style>
+       
+       <fx:Script>
+               <![CDATA[
+                       import models.ProductsModel;
+
+                       import mx.controls.DataGrid;
+                       import mx.controls.dataGridClasses.DataGridColumn;
+
+                       [Bindable]
+                       public var multipleSelectionState:Boolean = true;
+
+                       [Bindable]
+                       public var columnCount:int = 3;
+
+                       [Bindable]
+                       public var productsModel:ProductsModel;
+                       
+                       private var dg:DataGrid;
+                       
+                       private function onInitialize():void{
+                               productsModel = new ProductsModel();
+                               
+                               dg = new DataGrid();
+                               dg.width = 200;
+                               dg.setStyle("left", 10);
+                               dg.setStyle("top", 10);
+                               dg.setStyle("right", 10);
+                               dg.setStyle("bottom", 10);
+
+                               var dgCol:DataGridColumn = new DataGridColumn();
+                                       dgCol.width = 100;
+                                       dgCol.dataField = "title";
+                                       dgCol.showDataTips = true;
+                               
+                               var dgCol2:DataGridColumn = new 
DataGridColumn();
+                                       dgCol.width = 100;
+                                       dgCol.dataField = "detail";
+                                       
+                               dg.columns = [dgCol, dgCol2];
+                               
+                               dg.dataProvider = 
productsModel.alternateProductList;
+                               
+                               this.dgContainer.addChild(dg);
+                       }
+               ]]>
+       </fx:Script>
+<mx:HBox>
+       <mx:VBox id="dgContainer">
+               <mx:Label text="mx:DataGrid"/>
+       </mx:VBox>
+</mx:HBox>
+
+</mx:Application>
\ No newline at end of file
diff --git 
a/examples/mxroyale/DataGridInlineExample/src/main/royale/models/ProductsModel.as
 
b/examples/mxroyale/DataGridInlineExample/src/main/royale/models/ProductsModel.as
new file mode 100644
index 0000000..b035569
--- /dev/null
+++ 
b/examples/mxroyale/DataGridInlineExample/src/main/royale/models/ProductsModel.as
@@ -0,0 +1,62 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 models
+{
+       import mx.collections.ArrayCollection;
+       import products.Product;
+
+       public class ProductsModel
+       {
+               private var _productList:ArrayCollection = new ArrayCollection([
+            new Product("ps100","Widgets",44,200,"assets/smallbluerect.jpg"),
+            new Product("tx200","Thingys",5,285,"assets/smallgreenrect.jpg"),
+            new 
Product("rz300","Sprockets",80,105,"assets/smallyellowrect.jpg"),
+            new Product("dh440","Doohickies",10,340,"assets/smallredrect.jpg"),
+            new Product("ps220","Weejets",35,190,"assets/smallorangerect.jpg"),
+                       new 
Product("ga443","Gadgets",5,99,"assets/smallgreenrect.jpg"),
+                       new 
Product("dd123","Doodads",55,8077,"assets/smallyellowrect.jpg"),
+                       new 
Product("gr234","Gronkles",12,27,"assets/smallredrect.jpg"),
+                       new 
Product("wb754","Whizbangs",67,390,"assets/smallorangerect.jpg")
+               ]);
+
+               [Bindable("__NoChangeEvent__")]
+               public function get productList():ArrayCollection
+               {
+                       return _productList;
+               }
+               
+               private var _productArray:ArrayCollection = new 
ArrayCollection([
+                       new 
Product("ps100","Blueberries",44,200,"assets/smallbluerect.jpg"),
+                       new 
Product("tx200","Kiwis",5,285,"assets/smallgreenrect.jpg"),
+                       new 
Product("rz300","Bananas",80,105,"assets/smallyellowrect.jpg"),
+                       new 
Product("dh440","Strawberries",10,340,"assets/smallredrect.jpg"),
+                       new 
Product("ps220","Oranges",35,190,"assets/smallorangerect.jpg"),
+                       new 
Product("ps111","Mandarins",414,202,"assets/smallorangerect.jpg"),
+                       new 
Product("tx220","Loquats",51,185,"assets/smallyellowrect.jpg"),
+                       new 
Product("rz303","Guavas",810,1205,"assets/smallredrect.jpg"),
+                       new 
Product("dh490","Pears",120,3420,"assets/smallgreenrect.jpg"),
+                       new 
Product("ps222","Apples",315,1190,"assets/smallredrect.jpg")
+               ]);
+               
+               public function get alternateProductList():ArrayCollection
+               {
+                       return _productArray;
+               }
+       }
+}
diff --git 
a/examples/mxroyale/DataGridInlineExample/src/main/royale/products/Product.as 
b/examples/mxroyale/DataGridInlineExample/src/main/royale/products/Product.as
new file mode 100644
index 0000000..a4ff547
--- /dev/null
+++ 
b/examples/mxroyale/DataGridInlineExample/src/main/royale/products/Product.as
@@ -0,0 +1,89 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 products
+{
+       [Bindable]
+       public class Product
+       {
+               /*private var _id:String;
+               private var _title:String;
+               private var _detail:Number;
+               private var _image:String;
+               private var _sales:Number;*/
+
+
+               
+               public function Product(id:String, title:String, detail:Number, 
sales:Number, image:String)
+               {
+                       /*this._id = id;
+                       this._title = title;
+                       this._detail = detail;
+                       this._sales = sales;
+                       this._image = image;*/
+
+                       this.id = id;
+                       this.title = title;
+                       this.detail = detail;
+                       this.sales = sales;
+                       this.image = image;
+                       addRandomProductValues(this);
+
+               }
+               
+               /*public function get id():String
+               {
+                       return _id;
+               }
+               
+               public function get title():String
+               {
+                       return _title;
+               }
+               
+               public function get detail():Number
+               {
+                       return _detail;
+               }
+               
+               public function get image():String
+               {
+                       return _image;
+               }
+               
+               public function get sales():Number
+               {
+                       return _sales;
+               }*/
+
+               public var id:String;
+               public var title:String;
+               public var detail:Number;
+               public var image:String;
+               public var sales:Number;
+               public var marketShare:Number;
+               public var productGroup:String;
+               public var budget:Number;
+
+               
+               public function toString():String
+               {
+                       return title;
+               }
+       }
+}
diff --git 
a/examples/mxroyale/DataGridInlineExample/src/main/royale/products/addRandomADGColumns.as
 
b/examples/mxroyale/DataGridInlineExample/src/main/royale/products/addRandomADGColumns.as
new file mode 100644
index 0000000..8081000
--- /dev/null
+++ 
b/examples/mxroyale/DataGridInlineExample/src/main/royale/products/addRandomADGColumns.as
@@ -0,0 +1,50 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 products {
+
+    import mx.controls.advancedDataGridClasses.AdvancedDataGridColumn;
+
+    public function addRandomADGColumns(base:Array, max:int=3 , 
force:int=-1):void {
+
+        var rand:int = force == -1 ? 1 + uint(Math.random() * max) : force;
+        var col:AdvancedDataGridColumn = new AdvancedDataGridColumn('Market 
Share');
+        col.width = 120;
+        col.dataField = 'marketShare';
+        rand--;
+        base.push(col);
+        if (rand){
+            col = new AdvancedDataGridColumn('Product Group');
+            col.width = 120;
+            col.dataField = 'productGroup';
+            base.push(col);
+            rand--;
+
+        }
+
+        if (rand){
+            col = new AdvancedDataGridColumn('Budget');
+            col.width = 120;
+            col.dataField = 'budget';
+            base.push(col);
+            rand--;
+        }
+
+    }
+
+}
diff --git 
a/examples/mxroyale/DataGridInlineExample/src/main/royale/products/addRandomDGColumns.as
 
b/examples/mxroyale/DataGridInlineExample/src/main/royale/products/addRandomDGColumns.as
new file mode 100644
index 0000000..826237a
--- /dev/null
+++ 
b/examples/mxroyale/DataGridInlineExample/src/main/royale/products/addRandomDGColumns.as
@@ -0,0 +1,51 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 products {
+
+    import mx.controls.dataGridClasses.DataGridColumn;
+
+    public function addRandomDGColumns(base:Array, max:int=3 , 
force:int=-1):void {
+
+        var rand:int = force == -1 ? 1 + uint(Math.random() * max) : force;
+        var col:DataGridColumn = new DataGridColumn('Market Share');
+        col.width = 120;
+        col.dataField = 'marketShare';
+        rand--;
+        base.push(col);
+        if (rand){
+            col = new DataGridColumn('Product Group');
+            col.width = 120;
+            col.dataField = 'productGroup';
+            base.push(col);
+            rand--;
+
+        }
+
+
+        if (rand){
+            col = new DataGridColumn('Budget');
+            col.width = 120;
+            col.dataField = 'budget';
+            base.push(col);
+            rand--;
+        }
+
+    }
+
+}
diff --git 
a/examples/mxroyale/DataGridInlineExample/src/main/royale/products/addRandomProductValues.as
 
b/examples/mxroyale/DataGridInlineExample/src/main/royale/products/addRandomProductValues.as
new file mode 100644
index 0000000..b5c7927
--- /dev/null
+++ 
b/examples/mxroyale/DataGridInlineExample/src/main/royale/products/addRandomProductValues.as
@@ -0,0 +1,36 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 products {
+
+
+
+    public function addRandomProductValues(product:Product):void {
+        //marketShare:Number
+        product.marketShare = (50 + uint(Math.random() * 950))/1000;
+
+        //marketShare:Number
+        product.productGroup = productGroups[uint(Math.random()* 
productGroups.length)];
+
+        //budget:Number 50K -> 1M
+        product.budget = (50000 + uint(Math.random() * 20)*50000);
+
+    }
+
+}
+var productGroups:Array =['Shooting Stars', 'Stable', 'Unproven', 'CashCows', 
'MoneyPits'];
\ No newline at end of file

Reply via email to