anh tran
anh tran

Reputation: 159

auto scroll to the bottom of container in sencha touch 2

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

Upvotes: 0

Views: 2965

Answers (2)

Murtuza
Murtuza

Reputation: 382

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

Upvotes: 1

anh tran
anh tran

Reputation: 159

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 :)

Upvotes: 3

Related Questions