Creating a DividedBox, HDividedBox, and VDividedBox container
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundColor="white">
<mx:Script>
private function myGrid_initialize():void {
myGrid.dataProvider = [
{Artist:'A', Album:'aa',Price:11.99, Comment:'test'},
{Artist:'B', Album:'bb',Price:11.99, Comment:'test.'}
];
}
</mx:Script>
<mx:HDividedBox width="100%" height="100%">
<mx:Tree id="tree1" width="30%" height="100%" labelField="@label" showRoot="true">
<mx:XMLList>
<menuitem label="A">
<menuitem label="A1" isBranch="true" />
<menuitem label="A2">
<menuitem label="A11" />
<menuitem label="A12" />
<menuitem label="A13" />
</menuitem>
<menuitem label="A3" isBranch="true" />
<menuitem label="A4" isBranch="true" />
</menuitem>
</mx:XMLList>
</mx:Tree>
<mx:VDividedBox width="70%" height="100%">
<mx:DataGrid id="myGrid"
width="100%"
height="100%"
initialize="myGrid_initialize();"
change="currentMessage.text=event.currentTarget.selectedItem.Comment;" />
<mx:TextArea id="currentMessage"
width="100%"
height="60"
text="this is a test"/>
</mx:VDividedBox>
</mx:HDividedBox>
</mx:Application>
Related examples in the same category