You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by pi...@apache.org on 2020/03/15 09:31:28 UTC
[royale-asjs] branch develop updated: tour-de-jewel: Add DataGrid
example to show issue with setup fixed size on initComplete
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 17def01 tour-de-jewel: Add DataGrid example to show issue with setup fixed size on initComplete
new ca5f696 Merge branch 'develop' of https://github.com/apache/royale-asjs into develop
17def01 is described below
commit 17def018f4f9651839f336bf02a542835eabfaf4
Author: Piotr Zarzycki <pi...@gmail.com>
AuthorDate: Sun Mar 15 10:29:53 2020 +0100
tour-de-jewel: Add DataGrid example to show issue with setup fixed size on initComplete
---
.../src/main/royale/DataGridPlayGround.mxml | 43 ++++++++++++++++++----
1 file changed, 36 insertions(+), 7 deletions(-)
diff --git a/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml b/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
index 7774fc3..5a9a296 100644
--- a/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
@@ -18,11 +18,12 @@ limitations under the License.
-->
<c:ExampleAndSourceCodeTabbedSectionContent xmlns:fx="http://ns.adobe.com/mxml/2009"
- xmlns:j="library://ns.apache.org/royale/jewel"
- xmlns:html="library://ns.apache.org/royale/html"
- xmlns:js="library://ns.apache.org/royale/basic"
- xmlns:models="models.*"
- xmlns:c="components.*" sourceCodeUrl="DataGridPlayGround.mxml">
+ xmlns:j="library://ns.apache.org/royale/jewel"
+ xmlns:html="library://ns.apache.org/royale/html"
+ xmlns:js="library://ns.apache.org/royale/basic"
+ xmlns:models="models.*"
+ xmlns:c="components.*" sourceCodeUrl="DataGridPlayGround.mxml"
+ initComplete="onDataGridPlayGroundInitComplete(event)">
<fx:Script>
<![CDATA[
@@ -54,8 +55,6 @@ limitations under the License.
grid.dataProvider = data;
}
-
-
/**
* DataGridColumnLabelsChange nead needed
*/
@@ -144,6 +143,11 @@ limitations under the License.
(datagrid.dataProvider as ArrayList).removeAll();
// productModel.productList.removeAll();
}
+
+ private function onDataGridPlayGroundInitComplete(event:Event):void
+ {
+ this.dgFixedWidth.width = 500;
+ }
]]>
</fx:Script>
@@ -458,6 +462,31 @@ limitations under the License.
</j:DataGrid>
</j:Card>
</j:GridCell>
+ <j:GridCell desktopNumerator="1" desktopDenominator="2" tabletNumerator="1" tabletDenominator="2" phoneNumerator="1" phoneDenominator="1">
+ <j:Card>
+ <html:H3 text="Jewel DataGrid"/>
+
+ <j:Label text="Setup fixed size of DataGrid to 500px after initComplete. Last column has columnWidth=40."
+ multiline="true"/>
+
+ <j:DataGrid localId="dgFixedWidth" height="240" emphasis="secondary" rowHeight="42">
+ <j:beads>
+ <js:ConstantBinding
+ sourceID="listModel"
+ sourcePropertyName="iconDetailListData"
+ destinationPropertyName="dataProvider"/>
+ <j:RemoveDataGridItemRendererForArrayListData/>
+ </j:beads>
+ <j:columns>
+ <j:DataGridColumn label="Icon"
+ itemRenderer="itemRenderers.IconDataGridItemRenderer"/>
+ <j:DataGridColumn label="Label" dataField="label" align="center"/>
+ <j:DataGridColumn label="Is Jewel?" columnWidth="40"
+ itemRenderer="itemRenderers.CheckBoxDataGridItemRenderer"/>
+ </j:columns>
+ </j:DataGrid>
+ </j:Card>
+ </j:GridCell>
</j:Grid>
</c:ExampleAndSourceCodeTabbedSectionContent>