티스토리 뷰
기억하자정보
Adobe AIR : Flex 에서 FileSystemDataGrid control로 확장자 기준으로 파일 필터 하는 방법
LANIAN 2012. 5. 17. 18:24The following example shows how you can filter files based on file extensions in the Adobe AIR FileSystemDataGrid control by setting the extensions property.Full code after the jump.
<?xml version="1.0" encoding="utf-8"?> <!-- http://airexamples.com/2008/12/31/filtering-files-based-on-extension-type-in-the-filesystemdatagrid-control-in-adobe-air-using-flex/ --> <mx:WindowedApplication name="FileSystemDataGrid_extensions_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"> <mx:Script> <![CDATA[ private function init():void { arr = [dataGrid.nameColumn, dataGrid.typeColumn, dataGrid.sizeColumn]; } ]]> </mx:Script> <mx:Array id="arr" /> <mx:FileSystemDataGrid id="dataGrid" extensions="[mxml,xml,swf]" columns="{arr}" horizontalScrollPolicy="off" width="100%" height="100%" initialize="init();" /> </mx:WindowedApplication>
You can also set the extensions property in MXML using the <mx:extensions> tag, as seen in the following example:
<?xml version="1.0" encoding="utf-8"?> <!-- http://airexamples.com/2008/12/31/filtering-files-based-on-extension-type-in-the-filesystemdatagrid-control-in-adobe-air-using-flex/ --> <mx:WindowedApplication name="FileSystemDataGrid_extensions_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"> <mx:Script> <![CDATA[ private function init():void { arr = [dataGrid.nameColumn, dataGrid.typeColumn, dataGrid.sizeColumn]; } ]]> </mx:Script> <mx:Array id="arr" /> <mx:FileSystemDataGrid id="dataGrid" columns="{arr}" horizontalScrollPolicy="off" width="100%" height="100%" initialize="init();"> <mx:extensions> <mx:String>mxml</mx:String> <mx:String>xml</mx:String> <mx:String>swf</mx:String> </mx:extensions> </mx:FileSystemDataGrid> </mx:WindowedApplication>
You can also set the extensions property using ActionScript, as seen in the following example:
<?xml version="1.0" encoding="utf-8"?> <!-- http://airexamples.com/2008/12/31/filtering-files-based-on-extension-type-in-the-filesystemdatagrid-control-in-adobe-air-using-flex/ --> <mx:WindowedApplication name="FileSystemDataGrid_extensions_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"> <mx:Script> <![CDATA[ private function init():void { dataGrid.extensions = ['mxml', 'xml', 'swf']; arr = [dataGrid.nameColumn, dataGrid.typeColumn, dataGrid.sizeColumn]; } ]]> </mx:Script> <mx:Array id="arr" /> <mx:FileSystemDataGrid id="dataGrid" columns="{arr}" horizontalScrollPolicy="off" width="100%" height="100%" initialize="init();" /> </mx:WindowedApplication>
'기억하자정보' 카테고리의 다른 글
[플렉스/플래쉬] trace를 이용하여 variable/array/object 구조 출력하기 (0) | 2012.06.07 |
---|---|
리눅스에서 disk 사용량 확인 명령어 - du, df (0) | 2012.05.18 |
Adobe AIR :: FileSystemDataGrid Control 에서 날짜(date)로 정렬 (0) | 2012.05.17 |
jQuery div print 하기(iframe이용) (0) | 2012.05.15 |
Ubuntu 11.04 서버 영어 설치 후 SSH 접근 한글 깨짐 (0) | 2012.05.15 |
- 안내
- 궁금한 점을 댓글로 남겨주시면 답변해 드립니다.