flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MichaPooh <raspar_...@yahoo.fr>
Subject Re: columnHeaderGroup.getHeaderBounds returns null
Date Fri, 04 Oct 2013 11:00:20 GMT
Hi

Yes i think it depends on the issue you mentioned.

Sure i can provide a simple scenario: (i removed the <![CDATA[ - haven't
found how to post code) 

<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" 
		 xmlns:s="library://ns.adobe.com/flex/spark" 
		 xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%"
creationComplete="onCreationComplete()">
	<fx:Declarations>
		<!-- Place non-visual elements (e.g., services, value objects) here -->
	</fx:Declarations>
	<fx:Script>
		
			import mx.collections.ArrayCollection;
			import spark.components.TextInput;
			
			
			[Bindable] private var provider:ArrayCollection = new ArrayCollection([
				{a: "a1", b:"b1", c:"c1", d:"d1"},
				{a: "a2", b:"b2", c:"c2", d:"d2"},
				{a: "a3", b:"b3", c:"c3", d:"d3"}
			]);
			
			protected function onCreationComplete():void {
				layoutTextInputs();
			}
			
			protected function layoutTextInputs():void {
				var numCols:int = grid.columns.length;
				var w:Number = 0;
				
				for (var i:int=0; i<numCols; i++) {
					var header:Rectangle = grid.columnHeaderGroup.getHeaderBounds(i);
					var textInput:TextInput = new TextInput();
					
					textInput.left = header.x;
					textInput.width = header.width;
					fieldsContainer.addElement(textInput);
				}
			}
		
	</fx:Script>
	
	<s:VGroup width="400">
		<s:HGroup width="100%" id="fieldsContainer" gap="0"/>
		<s:DataGrid id="grid" width="100%"  dataProvider="{provider}"
horizontalCenter="0" verticalCenter="0">
			<s:columns>
				<s:ArrayList>
					<s:GridColumn dataField="a" width="50"/>
					<s:GridColumn dataField="b" width="100"/>
					<s:GridColumn dataField="c" width="150"/>
					<s:GridColumn dataField="d" width="100"/>
				</s:ArrayList>
			</s:columns>
		</s:DataGrid>
	</s:VGroup>
	
</s:Group>




--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/columnHeaderGroup-getHeaderBounds-returns-null-tp2976p2990.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Mime
View raw message