You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ca...@apache.org on 2017/01/15 01:03:38 UTC
git commit: [flex-asjs] [refs/heads/develop] - More examples,
Tables in Card and Table with icon buttons
Repository: flex-asjs
Updated Branches:
refs/heads/develop 01048a3e0 -> ecd8aa38b
More examples, Tables in Card and Table with icon buttons
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/ecd8aa38
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/ecd8aa38
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/ecd8aa38
Branch: refs/heads/develop
Commit: ecd8aa38b05339ccfc67b11074ec650a08aa48da
Parents: 01048a3
Author: Carlos Rovira <ca...@apache.org>
Authored: Sun Jan 15 02:03:34 2017 +0100
Committer: Carlos Rovira <ca...@apache.org>
Committed: Sun Jan 15 02:03:34 2017 +0100
----------------------------------------------------------------------
.../flexjs/MDLExample/src/main/flex/Cards.mxml | 1 -
.../flexjs/MDLExample/src/main/flex/Tables.mxml | 42 +++++++++++++++-
.../TableItemRendererWithIcons.mxml | 53 ++++++++++++++++++++
.../src/main/resources/mdl-styles.css | 5 ++
4 files changed, 99 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ecd8aa38/examples/flexjs/MDLExample/src/main/flex/Cards.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/MDLExample/src/main/flex/Cards.mxml b/examples/flexjs/MDLExample/src/main/flex/Cards.mxml
index 2a3b41d..3d1f82e 100644
--- a/examples/flexjs/MDLExample/src/main/flex/Cards.mxml
+++ b/examples/flexjs/MDLExample/src/main/flex/Cards.mxml
@@ -37,7 +37,6 @@ limitations under the License.
</mdl:CardSupportingText>
<mdl:CardActions border="true">
<mdl:Button text="Get Started" ripple="true" colored="true"/>
-
</mdl:CardActions>
<mdl:CardMenu>
<mdl:Button icon="true" ripple="true">
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ecd8aa38/examples/flexjs/MDLExample/src/main/flex/Tables.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/MDLExample/src/main/flex/Tables.mxml b/examples/flexjs/MDLExample/src/main/flex/Tables.mxml
index f4dbd22..76b7938 100644
--- a/examples/flexjs/MDLExample/src/main/flex/Tables.mxml
+++ b/examples/flexjs/MDLExample/src/main/flex/Tables.mxml
@@ -27,7 +27,7 @@ limitations under the License.
<models:TablesModel/>
</mdl:model>
- <mdl:Grid>
+ <mdl:Grid width="450" className="center-items">
<mdl:Table shadow="2" selectable="true" className="customTableItemRenderer">
<mdl:columns>
@@ -43,6 +43,46 @@ limitations under the License.
</mdl:beads>
</mdl:Table>
+ <mdl:Card shadow="2" width="450">
+ <mdl:CardTitle expand="true">
+ <mdl:CardTitleText text="Card Header"/>
+ </mdl:CardTitle>
+
+ <mdl:Table className="customTableItemRenderer" width="100%">
+ <mdl:columns>
+ <mdl:TableColumn headerText="Material" nonNumeric="true"/>
+ <mdl:TableColumn headerText="Quantity"/>
+ <mdl:TableColumn headerText="Unit price"/>
+ </mdl:columns>
+ <mdl:beads>
+ <js:ConstantBinding
+ sourceID="model"
+ sourcePropertyName="materials"
+ destinationPropertyName="dataProvider" />
+ </mdl:beads>
+ </mdl:Table>
+
+ <mdl:CardActions style="display:flex; ">
+ <mdl:Spacer/>
+ <mdl:Button text="Get Started" ripple="true" colored="true"/>
+ </mdl:CardActions>
+ </mdl:Card>
+
+ <mdl:Table shadow="8" className="tableItemRendererWithIcons">
+ <mdl:columns>
+ <mdl:TableColumn headerText="Material" nonNumeric="true"/>
+ <mdl:TableColumn headerText="Quantity"/>
+ <mdl:TableColumn headerText="Unit price"/>
+ <mdl:TableColumn headerText="Mood"/>
+ </mdl:columns>
+ <mdl:beads>
+ <js:ConstantBinding
+ sourceID="model"
+ sourcePropertyName="materials"
+ destinationPropertyName="dataProvider" />
+ </mdl:beads>
+ </mdl:Table>
+
</mdl:Grid>
</mdl:TabBarPanel>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ecd8aa38/examples/flexjs/MDLExample/src/main/flex/itemRenderers/TableItemRendererWithIcons.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/MDLExample/src/main/flex/itemRenderers/TableItemRendererWithIcons.mxml b/examples/flexjs/MDLExample/src/main/flex/itemRenderers/TableItemRendererWithIcons.mxml
new file mode 100644
index 0000000..b70f412
--- /dev/null
+++ b/examples/flexjs/MDLExample/src/main/flex/itemRenderers/TableItemRendererWithIcons.mxml
@@ -0,0 +1,53 @@
+<?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.
+
+-->
+<mdl:TableRowItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:js="library://ns.apache.org/flexjs/basic"
+ xmlns:mdl="library://ns.apache.org/flexjs/mdl"
+ xmlns="http://www.w3.org/1999/xhtml">
+
+ <fx:Script>
+ <![CDATA[
+ import vos.MaterialVO;
+
+ [Bindable("dataChange")]
+ public function get material():MaterialVO
+ {
+ return data as MaterialVO;
+ }
+ ]]>
+ </fx:Script>
+
+ <mdl:beads>
+ <js:ItemRendererDataBinding />
+ </mdl:beads>
+
+ <mdl:TableCell text="{material.materialName}" nonNumeric="true"/>
+ <mdl:TableCell text="{material.quantity}"/>
+ <mdl:TableCell text="{material.unitPrice}"/>
+ <mdl:TableCell>
+ <mdl:Button icon="true" colored="true">
+ <mdl:materialIcon>
+ <mdl:MaterialIconMood/>
+ </mdl:materialIcon>
+ </mdl:Button>
+ </mdl:TableCell>
+
+</mdl:TableRowItemRenderer>
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ecd8aa38/examples/flexjs/MDLExample/src/main/resources/mdl-styles.css
----------------------------------------------------------------------
diff --git a/examples/flexjs/MDLExample/src/main/resources/mdl-styles.css b/examples/flexjs/MDLExample/src/main/resources/mdl-styles.css
index c81d413..7174289 100644
--- a/examples/flexjs/MDLExample/src/main/resources/mdl-styles.css
+++ b/examples/flexjs/MDLExample/src/main/resources/mdl-styles.css
@@ -88,6 +88,11 @@ js|Image
IItemRenderer: ClassReference("itemRenderers.CustomTableItemRenderer");
}
+.tableItemRendererWithIcons
+{
+ IItemRenderer: ClassReference("itemRenderers.TableItemRendererWithIcons");
+}
+
.footerMiniLinkListItemRenderer
{
IItemRenderer: ClassReference("itemRenderers.FooterMiniLinkListItemRenderer");