PDA

View Full Version : scroller on Lists not resetting properly when changing data set



asevers
5 Mar 2011, 6:48 PM
When a list with a lot of items in it is scrolled to the bottom, refreshing the list with a smaller number of items does not cause the scroller to scroll to the top. Additionally, calling a list.scroller.moveTo(0,0) does not work correctly, causing the first item in the list to be partially or fully off the screen after the moveTo function is called.

damon1977
10 Mar 2011, 8:14 AM
I'm having the same problem.

To recreate this:

load a grouped list with X number of records. Scroll to the bottom of the list. Reload the store with Y number of records, where Y is less than X, or you can also apply a filter to the store. The list scroll position is not adjusted at all, making it appear as if there are no records, and a touch scroll will not bring the list records into view. The only way to bring them into view is by using the index bar.

I would expect the list to scroll back to the top when the store data is changed (either by load or filter), but it should at least adjust the list so records are within view and the touch scroll functionality works as expected.

damon1977
10 Mar 2011, 9:00 AM
Ok this works...



store.on('load', function(){
list.scroller.scrollTo({x: 0, y: 0}, false, null, true);
}, this);


I also call the same scrollTo after applying filters to the store, and that works as well.

jep
15 Jun 2011, 7:41 AM
Related bug:

http://www.sencha.com/forum/showthread.php?132969-Problems-filtering-list-store-after-scrolling-to-bottom&p=614485#post614485