Tim,
Thanks for all your help.
I've decided to do away with the editorDataField and simply added an
update function on the 'change' event inside the combobox itemEditor:
private function update(event:ListEvent):void {
data.CostCode = this.selectedItem.data;
}
Not sure if it's a good practice but I'm up and runnin'.
Thanks again for your help.
Jeff
--- In [email protected], "Tim Hoff" <[EMAIL PROTECTED]> wrote:
>
> Yeah, there's some good examples in the help docs. In your
> itemEditor, create a public variable. The name of this variable is
> what you will put in the dataGridColumn editorDataField property. In
> your itemEditor, cast the selected item data to the public variable,
> on the comboBox change event.
>
> -TH
>
> --- In [email protected], "securenetfreedom" <nv1000@>
> wrote:
> >
> > I tried using that earlier and got undesirable results:
> >
> > If I use editorDataField="data" then the text field is populated
> with
> > [object Object]. If I use editorDataField="data.CostCode" then I
> get a
> > runtime error that data.CostCode does not exist.
> >
> > Any ideas on how to use this properly?
> >
> > Thanks,
> >
> > Jeff
> >
> >
> >
> >
> > --- In [email protected], "Tim Hoff" <TimHoff@> wrote:
> > >
> > > Cool. Nothing wrong with using the itemEditEnd event. Works
> well if
> > > you need to message the data or update conditionally. A simpler
> way
> > > though, is to use the editorDataField propery.
> > >
> > > -TH
> > >
> > > --- In [email protected], "securenetfreedom" <nv1000@>
> > > wrote:
> > > >
> > > > Thanks, Tim!
> > > >
> > > > Works well. It displays the combobox's label property in the
> Text
> > > > field. However, I need to update the datagrid's dataprovider
> with
> > > the
> > > > 'data' property of the combobox.
> > > >
> > > > Currently I'm capturing the grid's itemEditEnd event and
> grabbing
> > > > event.itemRenderer.data.CostCode value and updating the grid's
> DP
> > > > manually. Something tells me there's an easier way.
> > > >
> > > > Here's the dataGridColumn:
> > > >
> > > > <mx:DataGridColumn headerText="Code"
> > > > dataField="CostCode"
> > > > itemEditor="controls.GridCBRenderer" >
> > > > <mx:itemRenderer>
> > > > <mx:Component>
> > > > <mx:Text selectable="false" width="100%"
> > > > text="{data.CostCode}" />
> > > > </mx:Component>
> > > > </mx:itemRenderer>
> > > > </mx:DataGridColumn>
> > > >
> > > > Thanks for your help.
> > > >
> > > > Jeff
> > > >
> > > >
> > > >
> > > > --- In [email protected], "Tim Hoff" <TimHoff@> wrote:
> > > > >
> > > > > Hi Jeff,
> > > > >
> > > > > Use the Label as the itemRenderer and the ComboBox as the
> > > itemEditor.
> > > > >
> > > > > -TH
> > > > >
> > > > > --- In [email protected], "securenetfreedom"
> <nv1000@>
> > > > > wrote:
> > > > > >
> > > > > > Is there a way to combine a combobox/label cell renderer
> for a
> > > > > > datagrid so that when the cell has NO focus is displays a
> label
> > > and
> > > > > > when the cell takes focus the combobox takes visibility?
> > > > > >
> > > > > > I have a label renderer and combobox renderer but I can't
> seem
> > > to
> > > > > get
> > > > > > them to work in tandem.
> > > > > >
> > > > > > Thanks in advance.
> > > > > >
> > > > > > Jeff
> > > > > >
> > > > >
> > > >
> > >
> >
>