I’m pretty new to Flex, so there’s probably a good chance I’m missing something obvious, but in the first example code, everything works as expected. When not editing the cell, it shows a centered date as plain text. When editing, it shows a DateField editor. The second example is exactly the same as far as I can tell, other than the fact that it is an AdvancedDataGridColumn. Using that code with an AdvancedDataGrid, when I go into edit mode I can see the text from the normal item renderer behind the DateField editor (between the text input and calendar icon). Did I do something wrong here? How can I hide that? Thanks in advance.
Example 1:
<mx:DataGridColumn id="endColumn"
dataField="endDate"
headerText="End"
editorDataField="selectedDate"
editable="true"
labelFunction="{this.formatDate}"
width="80"
textAlign="center" >
<mx:itemEditor>
<fx:Component>
<mx:DateField yearNavigationEnabled="true" formatString="DD/MM/YY" />
</fx:Component>
</mx:itemEditor>
</mx:DataGridColumn>
Example 2:
<mx:AdvancedDataGridColumn id="endColumn"
dataField="endDate"
headerText="End"
editorDataField="selectedDate"
editable="true"
labelFunction="{this.formatDate}"
width="80"
textAlign="center" >
<mx:itemEditor>
<fx:Component>
<mx:DateField yearNavigationEnabled="true" formatString="DD/MM/YY" />
</fx:Component>
</mx:itemEditor>
</mx:AdvancedDataGridColumn>
The space between the dateInput and the icon is normally transparent. I’m not sure why
mx:DataGridhides the rendered text and themx:AdvancedDataGriddoesn’t.Anyway, there’s an easy solution to your problem. Just paint the itemEditors background in the color you like. The following should work.