Note that there are some explanatory texts on larger screens.

plurals
  1. POdatefield itemrenderer
    text
    copied!<p>I try to create an editable datefield itemrenderer.</p> <p>This itemrenderer works fine if I click on calendar button. But if I put data with keyboard, data isn't updating, if field is focus out data become empty.</p> <p>See below my code</p> <p>Datagrid column is like that</p> <pre><code> &lt;mx:DataGridColumn dataField="echDate" headerText="Date" headerStyleName="dgHeader" itemEditor="ui.itemRenderer.irDateD" editorDataField="dateModif"/&gt; </code></pre> <p>and item editor is</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;s:MXDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" focusEnabled="true"&gt; &lt;fx:Script&gt; &lt;![CDATA[ import mx.controls.dataGridClasses.DataGridListData; import mx.controls.listClasses.BaseListData; import mx.events.CalendarLayoutChangeEvent; import mx.events.FlexEvent; [Bindable] public var dateModif:String; override public function set data(value:Object):void{ if(listData){ var newDate:Date; var value1 = value.echDate; if (value1 is String){ newDate = new DateUtility().dateStringToObject2(value1); super.data = newDate; dfDG.selectedDate = newDate; dfDG.text = value1; } else if (value1 is Date){ super.data = value as Date; dfDG.selectedDate = value1 as Date; dfDG.text = new DateUtility().DateAsToString(value1); } } } protected function dfDG_changeHandler(event:CalendarLayoutChangeEvent):void { dateModif=dfDG.text; } ]]&gt; &lt;/fx:Script&gt; &lt;mx:DateField id="dfDG" editable="true" formatString="DD/MM/YYYY" yearNavigationEnabled="true" width="95" change="dfDG_changeHandler(event)" &gt; &lt;/mx:DateField&gt; &lt;/s:MXDataGridItemRenderer&gt; </code></pre> <p>I'll happy if someone could help me to solve that</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload