|
Here is a sample app that does what I
think you want. <?xml version="1.0"
encoding="utf-8"?> <mx:Application
xmlns:mx="http://www.macromedia.com/2003/mxml"
horizontalAlign="left" initialize="initApp()"> <mx:Script><![CDATA[ public var gsBindMe:String =
"Change me!" ; // private var aDP2:Array; private function
initApp():Void { aDP2 = new
Array(); aDP2.push(["Pink
Floyd",29.99,"Meddle"]) aDP2.push(["Pink
Floyd",29.99,"More"]) aDP2.push(["Genesis",22.99,"Trespass"]) aDP2.push(["Yes",22.99,"Close
to the Edge"]) }// import
mx.containers.TitleWindow; import
mx.managers.PopUpManager; private function
showTitleWindow():Void { var
aSelected:Array = dg2.selectedItems; var
oInitObj:Object = new Object(); oInitObj.title =
"Title Window Data"; //built-in property oInitObj.width =
600; //built-in
property oInitObj.height =
600; //built-in
property oInitObj.mainApp =
this; //user-added property.
reference to main app oInitObj.gsMyString
= tiMyString.text; //user-added property. will contain value of text input oInitObj.itemsSelected
= aSelected; //user-added property. will contain array var
titleWindowInstance:Object = TitleWindow(PopUpManager.createPopUp(this,
TitleWindowData,
false,
oInitObj,
false)); //instantiate
and show the title window titleWindowInstance.centerPopUp(this) titleWindowInstance.gnMyNumber
= parseFloat(tiMyNumber.text); //titleWindowInstance must be Object
to use this } ]]></mx:Script> <mx:DataGrid
id="dg2" multipleSelection="true" dataProvider="{aDP2}"
> <mx:columns> <mx:Array> <mx:DataGridColumn
headerText="Artist" columnName="0" /> <mx:DataGridColumn
headerText="Price" columnName="1"
editable="true"/> <mx:DataGridColumn
headerText="Album" columnName="2" /> </mx:Array> </mx:columns>
</mx:DataGrid> <mx:HBox > <mx:Label
text="MyString:" width="100" /> <mx:TextInput
id="tiMyString" text="my string" /> </mx:HBox> <mx:HBox > <mx:Label text="MyNumber:"
width="100"/> <mx:TextInput
id="tiMyNumber" text="99"/> </mx:HBox> <mx:HBox > <mx:Label
text="Bind Me" width="100"/> <mx:TextInput
id="tiBindMe" text="{gsBindMe}" change="gsBindMe
= tiBindMe.text"/> </mx:HBox> <mx:Button label="ShowTitleWindow{newline}Non-Modal"
click="showTitleWindow()"/> </mx:Application> From:
[email protected] [mailto:[EMAIL PROTECTED] On Behalf Of rgwilson26 I got it
to work with the hard coded data. However, I cannot seem to pass an array
in my initObj correctly. Do I need another loop for my array or is there
somthing else I am not seeing? Thanks, *******************
|
- RE: [flexcoders] Re: Passing data between two datagrids Tracy Spratt

