0 Replies Latest reply on Dec 13, 2006 10:53 AM by YuliyaR

    DateField Error when used as ItemEditor in DataGridColumn

    YuliyaR
      Hi,

      When I use DateField by itself it works fine. When used as an itemEditor in a DataGroupColumn, once click on the date see this error below:
      TypeError: Error #1034: Type Coercion failed: cannot convert "12/09/2006" to Date.
      at mx.controls::DateField/set data()
      at mx.controls::DataGrid/::itemEditorItemEditBeginHandler()
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.controls::DataGrid/::commitEditedItemPosition()
      at mx.controls::DataGrid/mx.controls:DataGrid::updateDisplayList()
      at mx.core::UIComponent/validateDisplayList()
      at mx.managers::LayoutManager/::validateDisplayList()
      at mx.managers::LayoutManager/::doPhasedInstantiation()
      at Function/ http://adobe.com/AS3/2006/builtin::apply()
      at mx.core::UIComponent/::callLaterDispatcher2()
      at mx.core::UIComponent/::callLaterDispatcher()


      Code is:
      ---------------------

      <mx:Script>
      <![CDATA[

      [Bindable]


      public var myBDays:Array = [
      {bName:'Person1', bDate:'01/01/1985'},
      {bName:'Person2', bDate:'06/01/1985'},
      {bName:'Person3', bDate:'12/01/1985'},
      {bName:'Person4', bDate:'01/01/2005'}
      ];


      ]]>
      </mx:Script>


      <mx:DateField x="150" y="210" yearNavigationEnabled="true" minYear="2000" maxYear="2010" data="{myBDays[0].bDate}" />

      <mx:DataGrid dataProvider="{myBDays}" x="0" y="250" id="bDays" editable="true">
      <mx:columns>
      <mx:DataGridColumn headerText="Name" dataField="bName"/>
      <mx:DataGridColumn headerText="BirthDate" dataField="bDate">
      <mx:itemEditor>
      <mx:Component>
      <mx:DateField yearNavigationEnabled="true"/>
      </mx:Component>
      </mx:itemEditor>
      </mx:DataGridColumn>
      </mx:columns>
      </mx:DataGrid>