<?xml version="1.0" encoding="utf-8"?>
<mx:Panel xmlns:mx="http://www.macromedia.com/2003/mxml" title="従業員一覧" height="300" width="450">

<mx:Metadata>
	[Event("edit")]
</mx:Metadata>

<mx:Array id="mockData">
	<mx:Object>
		<empno>7934</empno>
		<ename>MILLER</ename>
		<sal>1300</sal>
		<dname>ACCOUNTING</dname>
	</mx:Object>
	<mx:Object>
		<empno>7839</empno>
		<ename>KING</ename>
		<sal>5000</sal>
		<dname>ACCOUNTING</dname>
	</mx:Object>
</mx:Array>

<mx:DataGrid id="grid" dataProvider="{mockData}">
<mx:columns>
<mx:Array>
<mx:DataGridColumn headerText="従業員番号" columnName="empno" />
<mx:DataGridColumn headerText="従業員名" columnName="ename" />
<mx:DataGridColumn headerText="給料" columnName="sal" />
<mx:DataGridColumn headerText="部署名" columnName="dname" />
</mx:Array>
</mx:columns>
</mx:DataGrid>
<mx:ControlBar>
<mx:Button label="編集" enabled="{grid.selectedItem != null}" click="dispatchEvent({type:'edit'})"/>
</mx:ControlBar>
</mx:Panel>