DataGrid의 labelFunction
──LANGUAGE/Flex 2009.04.21 13:00
public function gridDisplay(data:Object,column:DataGridColumn):String{
var date:Date = data.date;
return dateFormat(date);
}
private function dateFormat(date:Date):String{
var dateFormat:DateFormatter = new DateFormatter();
dateFormat.formatString = "YYYY年M月D日、EEEE曜日";
return dateFormat.format(date);
}
<mx:DataGrid textAlign="center" id="dg" width="100%" height="90%" dataProvider="{detailData}">
<mx:columns>
<mx:DataGridColumn width="120" headerText="日付" dataField="date" labelFunction="gridDisplay"/>
</mx:columns>
</mx:DataGrid>
'IT > Flex/Flash' 카테고리의 다른 글
[Flex] 컨트롤 컴포넌트(각종 속성정리) (0) | 2017.09.12 |
---|