You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2019/12/28 02:07:04 UTC

[royale-asjs] branch develop updated: jewel-datagrid: fix refreshGrid example

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

carlosrovira 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 957d272  jewel-datagrid: fix refreshGrid example
957d272 is described below

commit 957d272e618f4071ea7a0073507ed0566a59d526
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sat Dec 28 03:06:55 2019 +0100

    jewel-datagrid: fix refreshGrid example
---
 .../royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml   | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml b/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
index 281f99e..151751d 100644
--- a/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
@@ -31,6 +31,7 @@ limitations under the License.
 
         import vos.IconListVO;
         import vos.Product;
+        import org.apache.royale.collections.ArrayList;
 
         private function dataGridProductChange(grid:DataGrid, output:Label) : void
 		{
@@ -42,10 +43,10 @@ limitations under the License.
 			output.text = "Clicked on row " + grid.selectedIndex + " (Label: " + (grid.selectedItem as IconListVO).label + ")";
 		}
 
-		private function refreshGrid(grid:DataGrid):void
+		private function refreshGrid(grid:DataGrid, data:ArrayList):void
 		{
 			grid.dataProvider = null;
-			grid.dataProvider = (productModel as ProductModel).productList;
+			grid.dataProvider = data;
 		}
 
 		[Bindable]
@@ -106,7 +107,7 @@ limitations under the License.
 				</j:DataGrid>
 
 				<j:Label id="datagrid2_lb" text="DataGrid selection will be shown here"/>
-				<j:Button text="Refresh Grid" click="refreshGrid(datagrid2)" emphasis="primary"/>
+				<j:Button text="Refresh Grid" click="refreshGrid(datagrid2, (productModel as ProductModel).productList)" emphasis="primary"/>
 			</j:Card>
 		</j:GridCell>
 	</j:Grid>
@@ -155,7 +156,7 @@ limitations under the License.
 				</j:DataGrid>
 
 				<j:Label id="datagrid4_lb" text="DataGrid selection will be shown here"/>
-				<j:Button text="Refresh Grid" click="refreshGrid(datagrid4)" emphasis="primary"/>
+				<j:Button text="Refresh Grid" click="refreshGrid(datagrid4, (listModel as ListsModel).iconListData)" emphasis="primary"/>
 			</j:Card>
 		</j:GridCell>
 	</j:Grid>