Solved

Flex Data grid format coloum as date

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How popular is Java FX these days? 5 327
AdvancedDataGRid 4 258
parse string in as3 2 332
Directions for developing on IOS/iPAD 5 530
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…
Owning a franchise can be the dream of a lifetime. It provides a chance for economic growth. You can be as successful as you want.  To make your franchise successful, you need to market it successfully. Here are six of the best marketing strategies …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

747 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now