/** http://blog.flexexamples.com/2008/04/30/determining-when-the-datefield-control-is-opened-or-closed-in-flex/ */ package comps { import mx.collections.ArrayCollection; import mx.containers.VBox; import mx.controls.DataGrid; import mx.controls.DateField; import mx.controls.Label; import mx.core.Application; import mx.core.ClassFactory; import mx.events.DropdownEvent; public class MyDateField extends VBox { [Bindable] private var arrColl:ArrayCollection; private var dateField:DateField; private var dataGrid:DataGrid; public function MyDateField() { super(); init(); } private function init():void { arrColl = new ArrayCollection(); dateField = new DateField(); dateField.addEventListener(DropdownEvent.OPEN, dateField_openClose); dateField.addEventListener(DropdownEvent.CLOSE, dateField_openClose); dataGrid = new DataGrid(); dataGrid.dataProvider = arrColl; dataGrid.itemRenderer = new ClassFactory(mx.controls.Label); dataGrid.percentWidth = 100; dataGrid.percentHeight = 100; Application.application.appControlBar.addChild(dateField); addChild(dataGrid) } private function dateField_openClose(evt:DropdownEvent):void { arrColl.addItem(evt); } } }