In my tests, changing an element of one AC definitely does affect the
other (which is what I hoped), but looking at the documentation I
can't tell if that should be the case. From the docs: "The
ArrayCollection object does not represent any changes that you make
directly to the source array. Always use the ICollectionView or IList
methods to modify the collection. "

I am using the ICollectionView methods, but only on one of the
ArrayCollections, and the only way the second ArrayCollection is being
affected is that its source array is being modified. If you run this
simple example, you'll see that arr, ac1 and ac2 are all updated with
the new value:

arr = new Array({fn: "David", ln: "Bowie"}, {fn: "Jimi", ln: "Hendrix"});
ac1 = new ArrayCollection(arr);
ac2 = new ArrayCollection(arr);
                                
ac2.getItemAt(1).fn = "Bozo";

If anyone can provide any clarification it would be greatly appreciated.

TIA,
Ben

Reply via email to