[flexcoders] Re: Synchronizing two ArrayCollections

2009-07-21 Thread Craig
Thanks that worked beautifully my final code follows: private function dgClick():void { var curTick:String = dgOrdExt.selectedItem.Ticker; for (var i:int = 0; i Array_Exits.length; i++) { if ( Exits(Array_Exits.getItemAt(i).Ticker ==c

[flexcoders] Re: Synchronizing two ArrayCollections

2009-07-21 Thread Tim Hoff
Cool, I kind of like this way better though: private function dgClick():void { var curTick:String = dgOrdExt.selectedItem.Ticker; for each ( var exits:Exits in Array_Exits ) { if ( exits.Ticker == curTick ) { dgExits.selectedIndex =

[flexcoders] Re: Synchronizing two ArrayCollections

2009-07-20 Thread Craig
Actually after thinking about it, I should just add the 2nd Webservice result to the first ArrayCollection data model. They both share the same field 'Ticker' but have different fields thereafter. The first result is Array_OrdExt and the second is Arrray_Exits. The Array Build routines for both

[flexcoders] Re: Synchronizing two ArrayCollections

2009-07-20 Thread Craig
Take 3... after further review, to simplify things I have bound 2 separate ArrayCollection to separate DataGrids they both share one common field - Ticker.. I'd like to select the corresponding row programmatically in the second datagrid which contains the value for 'Ticker' that is selected in

[flexcoders] Re: Synchronizing two ArrayCollections

2009-07-20 Thread Tim Hoff
Going to have to loop: var curTick:String = dg1.selectedItem.Ticker; for (var i:int = 0; i dg2.dataProvider.length; i++) { if ( Object(dg2.dataProvider.getItemAt(i)).Ticker == curTick ) { dg2.selectedIndex = i; } } Depending on your model, you could use for each