Hello all,
I'm having trouble getting a selected item in the first dg to add to the
second dg when a button is pressed.  Can anyone take a look at my code and
see if you can point in the right direction?  Here is my existing code: 

<mx:Script>
        <![CDATA[
                import mx.collections.ArrayCollection;
                
                [Bindable]
                public var addons:ArrayCollection;
                
                private function addRow():void {
        
selected_addons.addItem(available_addons.getItem(available_addons.selectedIn
dex));
                }
        
        ]]>
        
</mx:Script>

<mx:HTTPService id="srv" url="addons.xml" useProxy="false"
    result="addons = new ArrayCollection(srv.result.list.unitaddon)"/>

<mx:Canvas label="Tab 1" width="100%" height="100%">
        <mx:DataGrid x="41" y="40" width="550" id="available_addons"
dataProvider="{addons}">
                <mx:columns>
                        <mx:DataGridColumn headerText="Type"
columnName="type"/>
                        <mx:DataGridColumn headerText="Unit"
columnName="unit"/>
                        <mx:DataGridColumn headerText="Price"
columnName="price"/>
                </mx:columns>
        </mx:DataGrid>
        <mx:Button x="541" y="204" label="Add" buttonDown="addRow()"/>

        <mx:Label x="41" y="14" text="Available Add Ons"/>
        <mx:DataGrid x="41" y="248" width="550" id="selected_addons">
                <mx:columns>
                        <mx:DataGridColumn headerText="Type"
columnName="type"/>
                        <mx:DataGridColumn headerText="Unit"
columnName="unit"/>
                        <mx:DataGridColumn headerText="Price"
columnName="price"/>
                </mx:columns>
        </mx:DataGrid>
        <mx:Label x="41" y="222" text="Selected Add Ons"/>
        <mx:Button x="518" y="398" label="Remove"/>
</mx:Canvas>

Rich Kroll
Application Developer

SITE Manageware, Inc.
2841 W. Cypress Creek Rd.
Fort Lauderdale, FL 33309
[EMAIL PROTECTED]
954-944-9020 x716





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to