I need to provide a list of choices for a user to select from in datagrid's column.
I am using classFactory to specify a class for the item Editor of that column. I am using startItemEditorSession to start editing session
and I am using endItemEditorSession to end it. After I run endItemEditorSession the data in the column is shown as [object ListItem].
Do I need to have an item Renderer as well for this column? Because my understanding I dont need it.
Thanks
My data object is ArrayCollection. I am changing my code to this:
<s:itemRenderer>
<fx:Component>
<s:GridItemRenderer>
<s:Label text="{data.FamhistRelationshipCode}"/>
</s:GridItemRenderer>
</fx:Component>
</s:itemRenderer>
I used XML to get rid of a binding message.
How can I check what data.FamhistRelationshipCode actually is?
Not sure I can simplify that much.
But here is what I have:
Column:
<editabledatagrid:EditableDataGridColumn
dataField="FamhistRelationshipCode"
editable="true"
headerText="Relationship">
</editabledatagrid:EditableDataGridColumn>
Grid creationComplete="grid_creationCompleteHandler(event)"
protected function grid_creationCompleteHandler(event:FlexEvent):void
{
// TODO Auto-generated method stub
var renderer1:ClassFactory = new ClassFactory(LabelItemRenderer);
var editor1:ClassFactory = new ClassFactory(DropDownItemRenderer);
var col1:EditableDataGridColumn = EditableDataGridColumn(grid.columns.getItemAt(0));
col1.itemEditor = editor1;
col1.itemRenderer = renderer1;
}
That takes me a bit further.
But when I start editing session I am getting:
Error: Object reference not set to an instance of an object.
If I dont create item Renderer I am not getting the error. Any idea?
Thanks for the help.
The first thing I see is that you don't need to create a sub-class of Column, the standard Column class should provide everything you need to specify an itemrenderer for the column. The other thing I would look at is your DropDownItemRenderer class. From the error you described it sounds like you didn't specify a labelFunction or labelField that tells the dropdown how to display the data.
North America
Europe, Middle East and Africa
Asia Pacific