-
9 Jan 2012 9:35 AM #1
Reset Panel Scroll Position
Reset Panel Scroll Position
Hi,
I am trying to reset the scroll position of a panel but cannot make it work.
Here is my code:
myPanel.getScrollable().getScroller().position = {x:0, y:0};
This is definetly not working. What am I doing wrong?
Thanks!!!
-
9 Jan 2012 10:07 AM #2
It seems that this code works but not completly. The scroll position goes back to the start once I scroll, but not automatically. Seems that some sort of "refresh", "update" or something like that method is missing.. This method must be being called when I scroll...
Help please!!
Thanks!!
-
10 Jan 2012 3:20 AM #3
Try this
Try this
Hi,
I am also investigating how to control the scroller programatically and found this undocumented method in the source code. I am not sure if it's reliable to use though.
CheersCode:myPanel.getScrollable().getScroller().scrollToAnimated(0,0)
Vitor
-
10 Jan 2012 4:43 AM #4
Hi Vitor,
Unfortunately that did not work either, but thanks!! Still looking for a solution then..
Cheers!!
Agustin.
-
10 Jan 2012 10:14 AM #5
Hi,
I just wanted to tell you that I've solved it.
This code is working for me...
Thanks!!Code:myPanel.getScrollable().getScroller().scrollTo({x: 0, y: 0}, true); myPanel.getScrollable().getScroller().refresh();
Agustin.
-
15 Jan 2012 9:11 AM #6
Works great!
Thank you.


Reply With Quote