Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Flex Data grid format coloum as date

Posted on 2008-10-03
1
10,471 Views
Last Modified: 2012-05-05
I was wondering in the flex data grid how would i format a column MM/DD/YY  
0
Comment
Question by:stargateatlantis
1 Comment
 
LVL 19

Accepted Solution

by:
Gary Benade earned 500 total points
ID: 22647607

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" >
	<mx:Script>
		<![CDATA[
			import mx.controls.dataGridClasses.DataGridColumn;
			import mx.controls.DataGrid;
			
			[Bindable] private var ds:Array = new Array(
			{theDate: new Date()},
			{theDate: new Date()});
			
			
			private function dateFunc( item:Object, column:DataGridColumn):String
			{
				return df.format( item.theDate);
			}
		]]>
	</mx:Script>
	<mx:DateFormatter id="df" formatString="MM/DD/YY"/>
	<mx:DataGrid x="39" y="10" width="575" height="420" dataProvider="{ds}">
		<mx:columns>
			<mx:DataGridColumn headerText="date" dataField="theDate" labelFunction="dateFunc" />
		</mx:columns>
	</mx:DataGrid>	
</mx:Application>

Open in new window

0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
adobe air 1 301
Flex SDK setup 1 353
Need to have horizontal scrollbar in AdvancedDatagrid next to the freezed columns. 4 370
Flex AS3 image Compression 2 739
First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
This article explains the steps required to use the default Photos screensaver to display branding/corporate images
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question