Flex Datagrid

Problem: Trying to reference a datagid using mx:label.
Normally this is an easy issue to solve but I am using an opensource custome datagrid component by "iwobanas".
Everything is working fine but I cant reference a column.  Normally a datagrid is created by:
<mx:DataGrid>
<mx:columns>
<mx:DataGridColumn headerText="Column 1" dataField="col1"/>
</mx:columns>
</mx:DataGrid>
.. and to reference a column with a label is
 <mx:Label text="{dg.selectedItem.col1}"/>

but the custom datagrid is different:

<controls:MDataGrid id="dataGrid"
dataProvider="{configitem.example}" width="100%" height="100%" verticalScrollPolicy="on">
<controls:columns>

 <dataGridClasses:MDataGridColumn dataField="examplelevel" headerText="Primary" width="50" filterEditor="com.iwobanas.controls.dataGridClasses.filterEditors.SliderFilterEditor" />
                      
<dataGridClasses:MDataGridColumn  id="eek" dataField="description" headerText="Description" width="100"/>

</controls:columns>

</controls:MDataGrid>

Im trying to reference the dataField "description" column and keep getting error


any ideas?
basil099Asked:
Who is Participating?
 
zzynxConnect With a Mentor Software engineerCommented:
>> 1120: Access of undefined property dg.
The id of your DataGrid is "dataGrid" not "dg"
0
 
zzynxSoftware engineerCommented:
>> Im trying to reference the dataField "description" column
Can't you use the id you've given?

eek  represents the MDataGridColumn you're trying to reference

>> and keep getting error
*How* do you try to reference it and *what error* do you get?
That's *always* good to tell us.
0
 
basil099Author Commented:

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
	xmlns:controls="com.iwobanas.controls.*" xmlns:local="*"
	xmlns:dataGridClasses="com.iwobanas.controls.dataGridClasses.*"
	layout="vertical">
	
	
	<mx:Script>
		<![CDATA[
			import mx.collections.ICollectionView;
			
			
		]]>
		
	</mx:Script>
	
<mx:XML id="configitem" source="assets/cidb.xml" />	
<mx:Style source="defaults.css" />
<mx:Panel title="Configuration Item Search" width="95%" height="95%" >

<controls:MDataGrid id="dataGrid" dataProvider="{configitem.ciname}"
	width="100%" height="100%" verticalScrollPolicy="on">			
<controls:columns>
<dataGridClasses:MDataGridColumn 
	dataField="ciname" headerText="CI" width="200" />
                	
<dataGridClasses:MDataGridColumn 
dataField="primarylevel" headerText="Primary" width="50"
filterEditor="com.iwobanas.controls.dataGridClasses.filterEditors.SliderFilterEditor" />
                	
<dataGridClasses:MDataGridColumn 
dataField="secondarylevel" headerText="Secondary" width="50"
filterEditor="com.iwobanas.controls.dataGridClasses.filterEditors.MultipleChoiceFilterEditor" />

<dataGridClasses:MDataGridColumn id="eek" dataField="description" headerText="Description" width="100"/>

</controls:columns>

</controls:MDataGrid>

<mx:Label text="{dg.selectedItem.description}"/>


<mx:ControlBar>
<local:SearchBox target="{dataGrid}" />
<mx:Spacer width="100%" />
<mx:Label text="{ICollectionView(dataGrid.dataProvider).length} / {dataGrid.originalCollection.length}" />
</mx:ControlBar>
</mx:Panel>


ERROR:
1120: Access of undefined property dg.
<mx:Label text="{dg.selectedItem.description}"/>

Open in new window

0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
basil099Author Commented:
<mx:Label text="{datagrid.selectedItem.description}"/>

ERROR:
1120: Access of undefined property datagrid.

0
 
zzynxSoftware engineerCommented:
Like I said:
The id of your DataGrid is "dataGrid" not "dg".

And not "datagrid" but "dataGrid" (capital 'G')
0
 
zzynxSoftware engineerCommented:
Thanx 4 axxepting
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.