Показать сообщение отдельно
Старый 12.10.2007, 14:19
Захаров вне форума Посмотреть профиль Отправить личное сообщение для Захаров Найти все сообщения от Захаров
  № 7  
Ответить с цитированием
Захаров

Регистрация: Oct 2007
Сообщений: 66
Прошу прощения но пример у вас не рабочий я немного его подправил:
Код:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" >
	<mx:Script>
		<![CDATA[
		[Bindable]
		private var _currentData:XML
		
		public function get currentData():XML
		{
			return _currentData
		}
		public function set currentData(value:XML):void
		{
			_currentData=value
		}
		]]>
	</mx:Script>
	<mx:XMLList id="dataProvider" xmlns="">
		<data name="Anton" content="man"/>
		<data name="Sergey" content="man"/>
		<data name="Jane" content="worman"/>
	</mx:XMLList>
	<mx:Panel width="100%" 
			  height="100%" 
			  headerHeight="10" 
			  paddingBottom="10" 
			  paddingLeft="10" 
			  paddingRight="10" 
			  paddingTop="10">    	
			<mx:VBox width="100%" height="100%">
				<mx:HDividedBox width="100%" height="100%">
					<mx:VBox width="100%" height="100%">
						<mx:DataGrid id="dataGrid" dataProvider="{dataProvider}" change="{_currentData = (dataGrid.selectedItem as XML)}" width="100%" height="100%">
							<mx:columns>
								<mx:DataGridColumn headerText="Name" dataField="@name"/>
								<mx:DataGridColumn headerText="Content" dataField="@content"/>
							</mx:columns>
						</mx:DataGrid>	
					</mx:VBox>
					<mx:VBox width="100%" height="100%">
						<mx:HBox width="100%">
							<mx:Label text="Name:" width="80"/>
							<mx:TextArea  id="nameTextArea" enabled="{(_currentData == null)? false : true}"  change="{_currentData.@name = nameTextArea.text}" text="{_currentData.@name}" width="100%"/>					
						</mx:HBox>				
						<mx:HBox width="100%" height="100%">
							<mx:Label text="Content:" width="80"/>	
							<mx:TextArea id="contentTextArea" width="100%" enabled="{(_currentData == null)? false : true}" text="{_currentData.@content}" change="{_currentData.@content = contentTextArea.text}" height="100%"/>									
						</mx:HBox>			
					</mx:VBox>
				</mx:HDividedBox>
			</mx:VBox>
	</mx:Panel>
</mx:Application>