You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by MichaPooh <ra...@yahoo.fr> on 2013/10/03 17:54:54 UTC

columnHeaderGroup.getHeaderBounds returns null

Hi

Compiling an application with the 4.10.0 framework
i found that the DataGrid->columnHeaderGroup->getHeaderBounds method returns
null.

i do not have this problem when i compile with 4.6

when i look up the new Apache docs (http://flex.apache.org/asdoc/),
I see that the page for the GridColumnHeaderGroup is all in italic.

I don't know if that has anything to do with this and if this means some
implementations are missing or something.

Thanks for any hints



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

Re: columnHeaderGroup.getHeaderBounds returns null

Posted by MichaPooh <ra...@yahoo.fr>.
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.

Re: columnHeaderGroup.getHeaderBounds returns null

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

This may be been fixed by this:
https://issues.apache.org/jira/browse/FLEX-33789

Any chance you could provide some sample code that shows the issue?

Thanks,
Justin