Solved

Flex Data grid format coloum as date

Posted on 2008-10-03
1
10,470 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AS3 Image Edit Package 3 557
Button sound on mouseover 4 476
unable to get fla to publish to swf 4 298
How to export vector graphics from Actionscript 3.0 SWF? 4 1,191
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…
SEO can be a real minefield to navigate, but there are three simple ways to up your SEO game just be re-assessing your content output.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
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…

770 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