[flexcoders] Re: Copying View of an ArrayCollection
Are you looking for the two ArrayCollections to always have the same filter and sort, or only occasionally? --- In flexcoders@yahoogroups.com, m.ar80 [EMAIL PROTECTED] wrote: How can view be copied from one array collection to another where both array collections share the same source? Apparently the only way to achieve this to call refresh on the destination array collection (with the same filter function and sort applied as that of the source array collection). But this is inefficient because the destination array collection need not be filtered and sorted since the filter status and sort position is already known in the source array collection. Thanks.
[flexcoders] Re: Copying View of an ArrayCollection
--- In flexcoders@yahoogroups.com, Dominic Pazula [EMAIL PROTECTED] wrote: Are you looking for the two ArrayCollections to always have the same filter and sort, or only occasionally? Hi Dominic. Thank you for your response. The two array collections will share the same source but not necessarily have the same filter and sort throughout their lifetimes. Only occasionally, and this is when I would like to copy source collection's view directly rather than re-filter and re-sort items in the destination collection.
[flexcoders] Re: Copying View of an ArrayCollection
I am not aware of a way to do what you want. I agree resorting/filtering is inefficient. Could you programmatically check for when that condition occurs and when it does just set the destination equal to the source? If you want to keep the destination around, then maybe set whatever is using the destination to use the source instead? --- In flexcoders@yahoogroups.com, m.ar80 [EMAIL PROTECTED] wrote: --- In flexcoders@yahoogroups.com, Dominic Pazula dompazz@ wrote: Are you looking for the two ArrayCollections to always have the same filter and sort, or only occasionally? Hi Dominic. Thank you for your response. The two array collections will share the same source but not necessarily have the same filter and sort throughout their lifetimes. Only occasionally, and this is when I would like to copy source collection's view directly rather than re-filter and re-sort items in the destination collection.
RE: [flexcoders] Re: Copying View of an ArrayCollection
Not sure I understand the question, but the source of an AC is never modified, so you can always make a copy of AC.source via AC.source.concat() to get a fresh unfiltered/unsorted copy of the data even if the AC currently is sorted/filtered. If the AC is sorted/filtered, you can copy that sorted/filtered version by calling toArray() From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Dominic Pazula Sent: Friday, April 11, 2008 11:04 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Copying View of an ArrayCollection I am not aware of a way to do what you want. I agree resorting/filtering is inefficient. Could you programmatically check for when that condition occurs and when it does just set the destination equal to the source? If you want to keep the destination around, then maybe set whatever is using the destination to use the source instead? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , m.ar80 [EMAIL PROTECTED] wrote: --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Dominic Pazula dompazz@ wrote: Are you looking for the two ArrayCollections to always have the same filter and sort, or only occasionally? Hi Dominic. Thank you for your response. The two array collections will share the same source but not necessarily have the same filter and sort throughout their lifetimes. Only occasionally, and this is when I would like to copy source collection's view directly rather than re-filter and re-sort items in the destination collection.