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 d2e3a13 Updated DataGrid examples to use new additions to the Express
DataGrid package.
d2e3a13 is described below
commit d2e3a13f2343a0e07e0acd3f22e2b479e9167e3a
Author: Peter Ent <[email protected]>
AuthorDate: Tue Feb 6 09:25:21 2018 -0500
Updated DataGrid examples to use new additions to the Express DataGrid
package.
---
.../src/main/royale/MyInitialView.mxml | 33 ++++++----------------
.../src/main/royale/GitHubCommitLogViewer.mxml | 4 +--
2 files changed, 10 insertions(+), 27 deletions(-)
diff --git
a/examples/express/DataGridExample/src/main/royale/MyInitialView.mxml
b/examples/express/DataGridExample/src/main/royale/MyInitialView.mxml
index bc47c8b..0e65c77 100644
--- a/examples/express/DataGridExample/src/main/royale/MyInitialView.mxml
+++ b/examples/express/DataGridExample/src/main/royale/MyInitialView.mxml
@@ -21,12 +21,12 @@ limitations under the License.
xmlns:js="library://ns.apache.org/royale/express">
<fx:Script>
<![CDATA[
+ import models.ProductsModel;
+
import org.apache.royale.collections.ArrayList;
import org.apache.royale.express.DataGrid;
+
import products.Product;
- import models.ProductsModel;
-
- [Bindable]private var provider:ArrayList = new
ArrayList();
override public function toString():String
{
@@ -39,26 +39,9 @@ limitations under the License.
trace("Click on row "+grid.selectedIndex);
}
- private function setProvider():void{
- provider.source = [
- 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")
- ];
-
- }
- private function addToProvider():void{
- var num:Number =
Number((Math.random()*1000).toFixed());
- provider.addItem(
- new Product("ps" +
num,"Weejets",35,num,"assets/smallorangerect.jpg")
- );
- }
-
private function addNewValue():void {
var item:String = newValue.text;
- if (item == "") item = "New Value";
+ if (item == "" || item == null) item = "New
Value";
var num:Number =
Number((Math.random()*100).toFixed());
var product:Product = new Product("abc123",
item, 30, num, "assets/smallorangerect.jpg");
(applicationModel as
ProductsModel).productList.addItem(product);
@@ -116,8 +99,8 @@ limitations under the License.
</js:beads>
<js:columns>
<js:DataGridColumn label="Image" dataField="image"
columnWidth="50" itemRenderer="products.ProductItemRenderer" />
- <js:DataGridColumn label="Name" dataField="title"
columnWidth="250" />
- <js:DataGridColumn label="Sales" dataField="sales"
columnWidth="100" />
+ <js:DataGridColumn label="Name" dataField="title"
columnWidth="100%" />
+ <js:DataGridColumn label="Sales" dataField="sales"
columnWidth="80" />
</js:columns>
</js:DataGrid>
@@ -153,8 +136,8 @@ limitations under the License.
</js:beads>
<js:columns>
<js:DataGridColumn label="Image" dataField="image"
columnWidth="50" itemRenderer="products.ProductItemRenderer" />
- <js:DataGridColumn label="Name" dataField="title"
columnWidth="250" />
- <js:DataGridColumn label="Sales" dataField="sales"
columnWidth="100" />
+ <js:DataGridColumn label="Name" dataField="title"
columnWidth="100%" />
+ <js:DataGridColumn label="Sales" dataField="sales"
columnWidth="80" />
</js:columns>
</js:DataGrid>
diff --git
a/examples/express/GitHubCommitLogViewer/src/main/royale/GitHubCommitLogViewer.mxml
b/examples/express/GitHubCommitLogViewer/src/main/royale/GitHubCommitLogViewer.mxml
index f4d8a5c..bbc9122 100644
---
a/examples/express/GitHubCommitLogViewer/src/main/royale/GitHubCommitLogViewer.mxml
+++
b/examples/express/GitHubCommitLogViewer/src/main/royale/GitHubCommitLogViewer.mxml
@@ -72,7 +72,7 @@ initialize="addEventListener('dataReady',
dataReadyHandler);configurator.send()"
private function dataReadyHandler(event:Event):void
{
- dg.dataProvider = new ArrayList(commits);
+ dg.dataProvider = commits; //new ArrayList(commits);
}
]]>
@@ -87,7 +87,7 @@ initialize="addEventListener('dataReady',
dataReadyHandler);configurator.send()"
<js:columns>
<js:DataGridColumn label="Date" dataField="date"
columnWidth="100"/>
<js:DataGridColumn label="Author" dataField="author"
columnWidth="100"/>
- <js:DataGridColumn label="Message" dataField="message"
columnWidth="400"/>
+ <js:DataGridColumn label="Message" dataField="message"
columnWidth="100%"/>
</js:columns>
</js:DataGrid>
<js:Label text="Selected Message:"/>
--
To stop receiving notification emails like this one, please contact
[email protected].