How to update nested ListCollectionViews?
hi troops,
my application has core set of items (e.g. products), gets passed between various view layers. each layer wraps given input list in listcollectionview, , adds own sorting , filtering.
that way might have construct similar to
new listcollectionview(new listcollectionview(new arraycollection()))
but, of course, sorting/filtering added on each level.
now when call itemupdated() on root arraycollection, change not propagate hierarchy of lists.
it seems each wrapping, have call itemupdated(), such as:
ac.itemupdated(product);
ac.itemupdated(product);
to make top-most listcollectionview update. single call not trick.
debugging code gave me insight initial collectionevent.update event ac converted move event listcollectionview. second call makes lcv realize item wouldn't move anymore , not convert event, next lcv can item-moved update of localindex.
yes, yes, complicated. feedback welcome, of course
for single original set of data, if want multiple views (with
different filters , sorts), share list or source. if you
share list, changes list propagated views.
original data:
var arr:array = ["foo", "bar", "baz"];
var ac:arraycollection = new arraycollection(arr);
var view1:listcollectionview = new listcollectionview();
view1.list = ac.list;
var view2:listcollectionview = new listcollectionview();
view2.list = ac.list;
More discussions in Flex (Read Only)
adobe
Comments
Post a Comment