Re: [flexcoders] Preventing Spark List from scrolling to top when adding / removing items.

2011-08-07 Thread dorkie dork from dorktown
See if this will work, // your code var index:int = list.selectedIndex; list.dataProvider.addItem(item); list.validateNow(); moveToIndex(index); protected function moveToIndex(index:int):void { var point:Point = list.layout.getScrollPositionDeltaToElement(index);

[flexcoders] Preventing Spark List from scrolling to top when adding / removing items.

2011-08-03 Thread vigilsolace
Any time I add or remove an item from a Spark list, the list resets itself to display the first element at the top. Is there a way to get the list to remember its current location? For example if I'm scrolled half way down a list and remove an item I would like the list to remain scrolled to