auto scroll to the bottom of container in sencha t

2019-09-09 10:53发布

问题:

I have a view that contains 2 parts: + Part 1: an ADD button + Part 2: a container LIST that has scroll attribute is auto.

When user clicks on button ADD, the system will add a container to container LIST. User can add as much as they want.

But my container LIST has limit height so I want to scroll to new container that added to container LIST when user clicks ADD button. Anyone help me. Thanks

回答1:

I tried to use:

var scroller = pan.getScrollable().getScroller();
scroller.scrollToEnd(true);

But it's not working. Then I tried another way:

var scroller = pan.getScrollable().getScroller();
scroller.scrollTo(x,y,true);// y = 100000000000

It's work :)



回答2:

var scroller = myListObject.getScrollable().getScroller();
scroller.scrollToEnd();