flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cosma Colanicchia <cosma...@gmail.com>
Subject Re: Copying ArrayCollections
Date Mon, 04 Nov 2013 16:03:27 GMT
Also, beware of which operations (.source, for each, toArray) are affected
by the current filterFunction / sort of the source ArrayCollection. For
example, for each and toArray should skip any filtered element, so you
actually end up with a different set of items in the copy.


2013/11/4 mark goldin <markzolotoy@gmail.com>

> By RESET do you mean collectionChange event?
>
>
> On Mon, Nov 4, 2013 at 8:12 AM, Maurice Amsellem <
> maurice.amsellem@systar.com> wrote:
>
> > Personally, I am using a third variant:
> >
> > Target.source = newSource.toArray();
> >
> > It has the advantage or not breaking any existing collection listeners,
> > and will generate only one RESET event.
> >
> > Maurice
> >
> > -----Message d'origine-----
> > De : mark goldin [mailto:markzolotoy@gmail.com]
> > Envoyé : lundi 4 novembre 2013 12:46
> > À : users
> > Objet : Copying ArrayCollections
> >
> > Is the following code functionally identical:
> >
> > target.removeAll();
> > for each (var item:* in source)
> > {
> > target.addItem(item);
> > }
> >
> > and this:
> > target = new ArrayCollection(source.toArray());
> >
> > Thanks
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message