I'd recommend using a labelFunction and a DateFormatter to accomplish this, because it is a lighter-weight solution than using an itemRenderer.

 

- Gordon

 


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tim Hoff
Sent: Monday, June 26, 2006 1:40 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: datagrid date formatting

 

Hi Hank,

You could use an itemRenderer component or do it in-line like this:

-TH

<mx:DataGridColumn  width="104" textAlign="center" dataField="myDate" headerText="My Date">
 <mx:itemRenderer>
  <mx:Component>
      <mx:VBox>
          <mx:DateFormatter id="df" formatString="MM/DD/YYYY"/>
             <mx:Text id="myDate" selectable="false" width="104" 
              text="{df.format(data.myDate)}" paddingLeft="5">
          </mx:VBox>
     </mx:Component>
   </mx:itemRenderer>
</mx:DataGridColumn>

--- In flexcoders@yahoogroups.com, "hank williams" <[EMAIL PROTECTED]> wrote:
>
> I have a datagrid that has a Date type column and I want ! to display the date
> in a mm/dd/yy format. The default is a really long format that includes the
> day of the week and the time. How do I tell a column how to format the date.
>
> Hank
>

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to