Friday, October 11, 2013

flex 4.5 And 3 Datagrid will using popup value change

 <?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
  xmlns:s="library://ns.adobe.com/flex/spark"
  xmlns:mx="library://ns.adobe.com/flex/mx"
  minWidth="955"
  minHeight="600">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var arr:ArrayCollection=new ArrayCollection([{id: "1", value: "anna"}, {id: "2", value: "rajiv"}, {id: "3", value: "siva"}]);
import mx.managers.PopUpManager;
public function linkbutton1_clickHandler(event:MouseEvent):void
{
var obj:Object = dg.selectedItem as Object;
var appPop:AppPopup = new AppPopup();
appPop.abc = obj.value as String;
PopUpManager.addPopUp(appPop,this,true);
}
]]>
</fx:Script>
<mx:HBox height="100%"
width="100%">
<s:DataGrid height="100%"
id="dg"
dataProvider="{arr}"
width="100%">
<s:columns>
<mx:ArrayList>
<s:GridColumn headerText="SNo"/>
<s:GridColumn headerText="Name"
 dataField="value">
<s:itemRenderer>
<fx:Component>
<s:GridItemRenderer>
<mx:HBox height="100%" width="100%">
<mx:LinkButton label="@{data.value}" click="{outerDocument.linkbutton1_clickHandler(event)}"/>

</mx:HBox>
</s:GridItemRenderer>
</fx:Component>
</s:itemRenderer>
</s:GridColumn>
</mx:ArrayList>
</s:columns>
</s:DataGrid>
</mx:HBox>
</s:Application>





======================AppPopup.mxml=======================
<?xml version="1.0" encoding="utf-8"?>
<s:TitleWindow close="PopUpManager.removePopUp(this)" xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="300"
height="400">
<fx:Script>
<![CDATA[
import mx.managers.PopUpManager;
public var abc:String;
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<mx:HBox height="100%" width="100%">
<s:Label text="{abc}" id="lblName"/>
</mx:HBox>
</s:TitleWindow>

No comments:

Post a Comment