Monday, November 18, 2013

flex Date Formate in datagrid and label


private function formatDateToString(dateObj:Object, column:GridColumn):String
{
var dateFormater:DateFormatter=new DateFormatter();
dateFormater.formatString="DD-MMM-YYYY H:NN:SS A";
var occDate:Date=new Date(Date.parse(dateObj.otAsesDate));
return dateFormater.format(occDate);
}

<s:GridColumn headerText="DATE" dataField="otAsesDate" labelFunction="formatDateToString"/>

---------------------------------------------------------------------------------------------

<s:Image buttonMode="true"
toolTip="Menu"
id="menuIcon"
source="@Embed('assets/images/Circle_Blue32.png')"
click="menuIcon_clickHandler(event)" backgroundColor="#F2F2F2"
mouseDownEffect="{mySounds}"/>
<mx:SoundEffect id="mySounds" source="@Embed('assets/chat_sound.mp3')"/>

-----------------------------------------------------------------------------------------------

<s:Label text="aa.com -" 
fontWeight="bold"
fontSize="18"
click="navigateToURL(new URLRequest('http://www.annadurai.com/'), 'quote')"/>

------------------------------------

private function formatDateToString(formatDate:Date):String
{
var dateFormater:DateFormatter=new DateFormatter();
dateFormater.formatString="DD MMM YYYY L:NN:SS A ";
var dateString:String=dateFormater.format(formatDate);
return dateString;
}


<s:Label text="{formatDateToString(data.time)}"
id="doc99ServerTime"/>
---------------------------------------

var bk:Booking_Popup = new Booking_Popup();
bk.setStyle("addedEffect", image_removedEffect);
bk.setStyle("removedEffect", image_removedEffect);

PopUpManager.addPopUp(bk, this, true);
PopUpManager.centerPopUp(bk);


<mx:Parallel id="image_removedEffect">
<mx:Zoom />
<mx:Fade />
</mx:Parallel>
-----------------------------
[Embed("/assets/RoomBooking/minus.gif")]
[Bindable]
public var minus:Class;

--------------------------------------------------------------------------------

<s:TextInput id="mySelectedTextInput2"
change="filter2()"
borderColor="#CCCCCC"
fontWeight="bold"
width="100%"
toolTip="Type To Search"
color="#808080"
prompt="Type to Search"/>
<s:DataGrid height="95%"
id="dgChargea"
borderVisible="false"
dataProvider="{fieldList}"
click="dgChargea_clickHandler(event)"
width="100%">
<s:columns>

<mx:ArrayList>
<s:GridColumn headerText="S No"
 labelFunction="serialNumb"
 sortable="false"
 editable="false"/>
<s:GridColumn headerText="Field Name"
 dataField="otPrecheckFieldName"/>
<s:GridColumn headerText="Category"
 dataField="categoryName"/>
<s:GridColumn headerText="Status"
 dataField="status"/>
</mx:ArrayList>
</s:columns>
</s:DataGrid>


private function filter2():void
{
fieldList.filterFunction=filterMyArrayCollection2;
fieldList.refresh();
}
private function filterMyArrayCollection2(item:Object):Boolean
{
var searchString:String=mySelectedTextInput2.text.toLowerCase();
var itemName:String=(item.otPrecheckFieldName as String).toLowerCase();
return itemName.indexOf(searchString) > -1;
}
---------------------------------------------------------------------------------

















No comments:

Post a Comment