Category
show
전체 (775)
웹표준, 웹접근성™ (5)
웹프로그래밍™ (360)
웹기획™ (0)
웹디자인™ (5)
서버™ (32)
데이터베이스™ (43)
개발자료 (9)
트랜드 (60)
Study English (2)
블루비 (70)
오피스 다이어리 (19)
Textcube (2)
이슈 (20)
컴퓨터 악세사리 (18)
엔터테인먼트 (24)
좋은글 (73)
재테크 (1)
이벤트 (4)

'2008/07/18'에 해당되는 글 1건

  1. 2008/07/18 [Flex] DataGrid, labelFunction='dateFormat'
1 

[Flex] DataGrid, labelFunction='dateFormat'

웹프로그래밍™/Flex,AIR,Flash 2008/07/18 15:03 by 블루비 Total 1072 : Today 5 : Yesterday 0
DataGrid에 dateFormat 설정하기

<mx:DateFormatter id="publishDate" formatString="YYYY.MM.DD" />
<mx:Script>
private function dateFormat(dateItem:Object, publish_date:DataGridColumn):String{
return publishDate.format(dateItem.publish_date);
}
</mx:Script>

<mx:DataGrid width="100%" dataProvider="{data}">
<mx:columns>
<mx:DataGridColumn dataField="name" headerText="Name"/>
<mx:DataGridColumn dataField="date" headerText="Date" labelFunction="dateFormat" />
</mx:columns>
</mx:DataGrid>


또는DateFormatter 태그 사용 없이 스크립트에서 직접 사용

<mx:Script>
private function dateFormat(dateItem:Object, rdate:DataGridColumn):String{
var df:DateFormatter = new DateFormatter();
df.formatString = "YYYY.MM.DD";
return df.format(dateItem.rdate);
}

</mx:Script>

2008/07/18 15:03 2008/07/18 15:03

TRACKBACK :: http://blueb.net/blog/trackback/1266

Leave a Comment
[로그인][오픈아이디란?]
1 

달력

«   2008/07   »
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31