incubator-flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcl...@apache.org
Subject svn commit: r1297851 - in /incubator/flex/whiteboard/jmclean/datagrid: ./ src/ src/ItemRenderer.mxml src/TooMuchValidation.mxml
Date Wed, 07 Mar 2012 03:29:27 GMT
Author: jmclean
Date: Wed Mar  7 03:29:27 2012
New Revision: 1297851

URL: http://svn.apache.org/viewvc?rev=1297851&view=rev
Log:
Too much validation datagrid example

Added:
    incubator/flex/whiteboard/jmclean/datagrid/
    incubator/flex/whiteboard/jmclean/datagrid/src/
    incubator/flex/whiteboard/jmclean/datagrid/src/ItemRenderer.mxml
    incubator/flex/whiteboard/jmclean/datagrid/src/TooMuchValidation.mxml

Added: incubator/flex/whiteboard/jmclean/datagrid/src/ItemRenderer.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/jmclean/datagrid/src/ItemRenderer.mxml?rev=1297851&view=auto
==============================================================================
--- incubator/flex/whiteboard/jmclean/datagrid/src/ItemRenderer.mxml (added)
+++ incubator/flex/whiteboard/jmclean/datagrid/src/ItemRenderer.mxml Wed Mar  7 03:29:27 2012
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<s:MXAdvancedDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" 
+								  xmlns:s="library://ns.adobe.com/flex/spark" 
+								  xmlns:mx="library://ns.adobe.com/flex/mx">
+		<fx:Script>
+			<![CDATA[
+				[Bindable] public var called:int = 0;
+				
+				override public function validateNow():void {
+					called++;
+					super.validateNow();
+				}
+			]]>
+		</fx:Script>
+
+	<s:Label text="{called}" />
+</s:MXAdvancedDataGridItemRenderer>

Added: incubator/flex/whiteboard/jmclean/datagrid/src/TooMuchValidation.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/jmclean/datagrid/src/TooMuchValidation.mxml?rev=1297851&view=auto
==============================================================================
--- incubator/flex/whiteboard/jmclean/datagrid/src/TooMuchValidation.mxml (added)
+++ incubator/flex/whiteboard/jmclean/datagrid/src/TooMuchValidation.mxml Wed Mar  7 03:29:27
2012
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx">
+	<s:layout>
+		<s:VerticalLayout />
+	</s:layout>
+	
+	<fx:Script>
+		<![CDATA[
+			import mx.collections.ArrayCollection;
+			import mx.controls.dataGridClasses.DataGridColumn;
+			import mx.events.AdvancedDataGridEvent;
+			
+			[Bindable] public var rowcols:ArrayCollection = new ArrayCollection([
+				{col0:0, col1:0, col2:0, col3:0, col4:0},
+				{col0:0, col1:0, col2:0, col3:0, col4:0},
+				{col0:0, col1:0, col2:0, col3:0, col4:0},
+				{col0:0, col1:0, col2:0, col3:0, col4:0}
+			]);		
+			
+			/* 
+			* To reproduce  bug
+			* 1. Roll over cells watch count go up
+			* ISSUE only changed cells only need to be validated and only once!
+			*/
+			
+			protected function showCalled(item:Object, column:DataGridColumn):String {
+				return String(item.called);
+			}
+			
+		]]>
+	</fx:Script>
+	
+	<mx:AdvancedDataGrid id="datagrid" dataProvider="{rowcols}" selectable="true" itemRenderer="ItemRenderer"
/>
+</s:Application>



Mime
View raw message