Flex Data grid format coloum as date

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

Accepted Solution

Gary Benade earned 2000 total points
ID: 22647607

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" >
			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:DateFormatter id="df" formatString="MM/DD/YY"/>
	<mx:DataGrid x="39" y="10" width="575" height="420" dataProvider="{ds}">
			<mx:DataGridColumn headerText="date" dataField="theDate" labelFunction="dateFunc" />

Open in new window


Featured Post

Live webcast with Pinal Dave

Pinal Dave will teach you tricks to help identify the real root cause of database problems rather than red herrings. Attendees will learn scripts that they can use in their environment to immediately figure out their performance Blame Shifters and fix them quickly.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

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…
Starting a business requires forethought, planning and preparation. As eager as you are to get started with business activities, you need to walk through a few important steps to ensure that your business gets off on the right foot.
How to fix display issue, screen flickering issue when I plug in power cord to the machine. Before I start explaining the solution lets check out once the issue how it looks like after I connect the power cord. most of you also have faced this…
In this video I will demonstrate how to set up Nine, which I now consider the best alternative email app to Touchdown.

597 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