I am not fully understanding your question.

 

When you click on an item in the source dataGrid, build an arrayCollection containing the data you want in the destination grid, and then pass that data into the custom component, where it is bound to the destination dataGrid.

 

How are you choosing the subset of data?

 

How are you passing it into the custom component?

 

For that matter, why are you extending the dataGrid in this case at all?  Not that you shouldn’t, I am just curious as to why.

 

Tracy

 

 

 

 


From: [email protected] [mailto:[email protected]] On Behalf Of s_hernandez01
Sent: Wednesday, August 09, 2006 5:53 PM
To: [email protected]
Subject: [flexcoders] Re: passing data to a datagrid

 

Hi Tracy

That is similar to what I'm doing on my code at the bottom except my
arraycollection is in the destination grid and not the source, which
is how I wish to execute it, but how do I go about doing that? I only
want specific data to go to the destination grid, not all the data
that's in that index. Do you have any examples I could see to help me
better understand this?

-Sal

--- In [EMAIL PROTECTED]ups.com, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> In general terms, build an ArrayCollection from the data you want to
> pass, and assign that ArrayCollection to the dataprovider property of
> the second grid.
>
>
>
> Tracy
>
>
>
> ________________________________
>
> From: [EMAIL PROTECTED]ups.com [mailto:[EMAIL PROTECTED]ups.com] On
> Behalf Of s_hernandez01
> Sent: Wednesday, August 09, 2006 9:43 AM
> To: [EMAIL PROTECTED]ups.com
> Subject: [flexcoders] passing data to a datagrid
>
>
>
> Hey Flexers,
>
> I am trying to send specific data from a datagrid to another datagrid
> and am having trouble with my actionscript. I can manage to send data
> if the index is selected, but I only want to send certain data to the
> other datagrid. Can anyone help? Here is what I have so far...
>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
> <http://www.adobe.com/2006/mxml> "
> layout="absolute" xmlns="*" creationComplete="init()">
>
> <mx:Script>
> <![CDATA[
> import mx.collections.ArrayCollection;
> import mx.effects.*;
> import mx.core.*;
>
> public function init():void{
> srv.send();
> addEventListener("send",doSendEvent);
> }
>
> public function doSendEvent(event:Event):void{
> addToGrid(event.target.data);
> }
>
> public function addToGrid(product:Object):void{
> destGrid.addItem({cat: product.cat, upc: product.upc, description:
> product.description});
> }
> ]]>
> </mx:Script>
>
> <mx:HTTPService id="srv" url="">xml" useProxy="false"
> result="(srv.lastResult.catalog.product)"/>
>
> <mx:HBox x="0" y="0" width="100%" height="100%"
> verticalAlign="middle" horizontalAlign="center">
>
> <mx:DataGrid dataProvider="{srv.lastResult.catalog.product}"
> id="srcGrid" itemClick="init()">
> <mx:columns>
> <mx:DataGridColumn headerText="UPC" dataField="cat" width="60"/>
> <mx:DataGridColumn headerText="CAT NO." dataField="upc" width="60"/>
> <mx:DataGridColumn headerText="DESCRIPTION" dataField="description"
> width="300"/>
> <mx:DataGridColumn headerText="WEIGHT" dataField="wgt" width="60"/>
> <mx:DataGridColumn headerText="BALANCE" dataField="balance" width="60"/>
> </mx:columns>
> </mx:DataGrid>
>
> <DestGrid id="destGrid" width="50%" height="20%"/>
>
> </mx:HBox>
> </mx:Application>
>
> <mx:DataGrid xmlns:mx="http://www.adobe.com/2006/mxml
> <http://www.adobe.com/2006/mxml> "
> dataProvider="{myDP}">
>
> <mx:Script>
> <![CDATA[
> import mx.collections.ArrayCollection;
> import mx.effects.*;
> import mx.core.*;
>
> [Bindable]
> public var myDP:ArrayCollection = new ArrayCollection();
>
> public function addItem(item:Object):void{
> myDP.addItem(item);
> }
> ]]>
> </mx:Script>
> <mx:columns>
> <mx:DataGridColumn headerText="UPC" dataField="cat" width="60"/>
> <mx:DataGridColumn headerText="CAT NO." dataField="upc" width="60"/>
> <mx:DataGridColumn headerText="DESCRIPTION" dataField="description"
> width="300"/>
> </mx:columns>
> </mx:DataGrid>
>

__._,_.___

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





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to