티스토리 뷰

Programming/Flex

Flex DataGrid 동적으로 Column 생성하기

파란크리스마스 2007. 8. 3. 10:29
728x90

출처
http://www.ihelpers.co.kr/programming/tipntech.php?CMD=view&TYPE=8&KEY=&SC=S&&CC=&PAGE=1&IDX=547

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" height="448">
  <mx:Script>
   import mx.controls.dataGridClasses.DataGridColumn;

    private function createColumn():void
    {
     var columns : Array = grid1.columns;
     var tmpCol :DataGridColumn =  new DataGridColumn();
     tmpCol.headerText = "Test";
     columns.push(tmpCol);
     
     grid1.columns = columns;
    }
  </mx:Script>
 
  <mx:DataGrid id="grid1" x="54" y="106" width="280" height="139"/>
 
  <mx:Button x="310" y="41" label="Button" click="{createColumn()}"/>
 
</mx:Application>

댓글
300x250
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/11   »
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
글 보관함