views:

240

answers:

1

Hi!

I am trying to get the selected date on the datagrid. I used the itemrenderer to display the datefield on my datagrid.

<mxataGridColumn dataField="dt" headerText="Date of Transaction" itemRenderer="mx.controls.DateField" rendererIsEditor="true" editorDataField="selectedDate"/>

Thanks!

A: 

Calling into renderers is the wrong way round, have the renderer bubble an event out with the selectedDate and the id of the data item it is rendering. Handle the event outside of the renderer.

Gregor Kiddie
uhhm. i'm quite a newbie with flex so i don't think i understood what you're trying to point out. can you kindly give me some hints on how exactly i can do it? :)
Kim Rivera
You'll need to roll your own renderer.Have it extend DateField.unfortunately, the changeHandler for the selectedDate changing is private rather than protected, so you have to do this the clunky way.override createChildren and add an event listener for a CalendarLayoutChangeEvent.CHANGE.In your handler for this, dispatch a custom event which contains the event.newDate property and whatever you use in your data item for id. Make sure it bubbles.Add a listener for this event to your DataGrid, and do whatever you need to do with it.
Gregor Kiddie