특별한딸기이야기
datagrid, advancedatagrid 본문
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private function onChange() : void
{
var msg : String;
msg = "selectedIndex - " + String(grdFruits.selectedIndex) + "\n";
msg += "selectedItem.data - " + String(grdFruits.selectedItem.data) + "\n";
msg += "selectedItem.label - " + String(grdFruits.selectedItem.label) + "\n";
Alert.show(msg);
}
]]>
</mx:Script>
<mx:ArrayCollection id="fruits">
<mx:source>
<mx:Object label="사과" data="55" org="대구"/>
<mx:Object label="배" data="66" org="천안"/>
<mx:Object label="복숭아" data="77" org="나주" />
<mx:Object label="감" data="88" org="제주" />
<mx:Object label="자두" data="99" org="경기"/>
</mx:source>
</mx:ArrayCollection>
<mx:DataGrid x="71" y="46" id="grdFruits" dataProvider="{fruits}" fontSize="12" editable="true">
<mx:columns>
<mx:DataGridColumn headerText="과일" dataField="label" />
<mx:DataGridColumn headerText="가격" dataField="data" />
<mx:DataGridColumn headerText="원산지" dataField="org" />
</mx:columns>
</mx:DataGrid>
<mx:Button x="71" y="205" label="선택보여주기" width="302" id="btnSelect" fontSize="12" click="onChange()" />
</mx:Application>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private function onChange() : void
{
var msg : String;
msg = "selectedIndex - " + String(grdFruits.selectedIndex) + "\n";
msg += "selectedItem.data - " + String(grdFruits.selectedItem.data) + "\n";
msg += "selectedItem.label - " + String(grdFruits.selectedItem.label) + "\n";
Alert.show(msg);
}
]]>
</mx:Script>
<mx:ArrayCollection id="fruits">
<mx:source>
<mx:Object label="사과" data="55" org="대구"/>
<mx:Object label="배" data="66" org="천안"/>
<mx:Object label="복숭아" data="77" org="나주" />
<mx:Object label="감" data="88" org="제주" />
<mx:Object label="자두" data="99" org="경기"/>
</mx:source>
</mx:ArrayCollection>
<mx:DataGrid x="71" y="46" id="grdFruits" dataProvider="{fruits}" fontSize="12" editable="true">
<mx:columns>
<mx:DataGridColumn headerText="과일" dataField="label" />
<mx:DataGridColumn headerText="가격" dataField="data" />
<mx:DataGridColumn headerText="원산지" dataField="org" />
</mx:columns>
</mx:DataGrid>
<mx:Button x="71" y="205" label="선택보여주기" width="302" id="btnSelect" fontSize="12" click="onChange()" />
</mx:Application>
'딸기 공부방 > flex' 카테고리의 다른 글
graphic (1) | 2008.12.27 |
---|---|
horizontallist, tilelist (1) | 2008.12.27 |
tree-xml (1) | 2008.12.27 |
drag & drop (0) | 2008.12.27 |
horizontallist, tilelist (0) | 2008.12.26 |