View Single Post
Old 05-19-2011, 08:23 PM   PM User | #3
bon_t
New Coder

 
Join Date: Jul 2010
Posts: 32
Thanks: 1
Thanked 0 Times in 0 Posts
bon_t is an unknown quantity at this point
Hi John,

Thanks for your quick reply. As requested, here is my AdvancedDataGrid definition in whole. I've not written the code yet for the labelFunction because I'm still having trouble putting everything in the proper scopes.

Code:
<mx:AdvancedDataGrid x="115" y="288" id="labelsGrid" designViewDataType="flat" dataProvider="{labelsGridArray}">
	<mx:columns>
		<mx:AdvancedDataGridColumn id="tag" headerText="Tag" dataField="tag" width="90" labelFunction="tag_labelFunction">
			<mx:itemEditor>
				<fx:Component>
					<mx:HBox>
						<mx:TextInput id="ti"/>
					</mx:HBox>
				</fx:Component>
			</mx:itemEditor>
		</mx:AdvancedDataGridColumn>
		<fx:Script> 
			<![CDATA[
				import mx.controls.advancedDataGridClasses.AdvancedDataGridColumn;
					
				protected function tag_labelFunction( item:Object, column:AdvancedDataGridColumn ):void
				{
					var formattedText:String = "";
						
					tag.ti.htmlText = formattedText;
				}
			]]>
		</fx:Script>		
	</mx:columns>
</mx:AdvancedDataGrid>
The statement
tag.ti.htmlText = formattedText;
generates the following error:
Access of possibly undefined property ti through a reference with static type mx.controls.advancedDataGridClasses.AdvancedDataGridColumn

I've tried moving the function definition within the Hbox, but then the AdvancedDataGridColumn can't access it.

Help!
Bonnie
bon_t is offline   Reply With Quote