Solved

Flex Data grid format coloum as date

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

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 shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
Send secure, cloud-based, encrypted alerts and maintain HIPAA compliant messaging. Integrates priority & secure messaging into one application. Ensures IT, emergency respondents and healthcare professionals that their critical messages are never mis…

914 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

18 Experts available now in Live!

Get 1:1 Help Now