DateChooser in Flex4


 

DateChooser in Flex4

The DateChooser control is a MX component. It has no Spark component. The DateChooser control contains the year, a month and a grid of the day of the month.

The DateChooser control is a MX component. It has no Spark component. The DateChooser control contains the year, a month and a grid of the day of the month.

DateChooser control in flex4:

The DateChooser control is a MX component. It has no Spark component. The DateChooser control contains the year, a month and a grid of the day of the month. It has columns labeled for the days of the week. It is very useful for choose a date. This component likes a continually visible calendars.
You can change a month by left or right arrow. Only single date can be selected at a time from the grid. The tag of DateChooser control is <mx:DateChooser>.

Example:

<?xml version="1.0"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

xmlns:s="library://ns.adobe.com/flex/spark"

xmlns:mx="library://ns.adobe.com/flex/mx">

<fx:Script>

<![CDATA[

import mx.events.CalendarLayoutChangeEvent;

public function formatdate(Obj:CalendarLayoutChangeEvent):void {

date.text= (Obj.currentTarget.selectedDate.getMonth() + 1) +

"/" + (Obj.currentTarget.selectedDate.getDate() +

"/" +Obj.currentTarget.selectedDate.getFullYear());

}

]]>

</fx:Script>

<s:Panel title="DateChooser Control Example" width="198" height="288">

<mx:DateChooser id="date1" change="formatdate(event)" x="9" y="39" width="177"/>

<s:Label text="Selected Date:" x="10" y="11"/>

<s:TextInput id="date" x="93" y="7" width="93"/>

</s:Panel>

</s:Application>

This is example for DateChooser control. Please choose a date from DateChooser control.

Output:

Running Application:

To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed.

Download this code

Ads