15 May 2009 2:18 PM #1
Automatic Scrolling Grid
I'm trying to get a Grid to automatic scrool to the end, reload the store and start to scroll again in a loop.
On reload, the size of the view can change, so I need to know when the scroll reaches the end to reload.
To scroll, I'm currently thinking in do a grid.view.scroller.scrollTo('t', n+1, true) in a loop. But I don't know how to discovery if I reach the end.
If I scroll to the end and do a grid.view.scroller.getScroll(), it return an object with left and top. The top is what I need. So... There is a way to get this maximum top value without the need to scroll down to know that value?
Thanks 4 n help!LAMPE (Linux / Apache / MySQL / PHP / ExtJs)
16 May 2009 12:19 AM #2
- Join Date
- Mar 2007
- Notts/Redwood City
- Vote Rating
Isn't it just a bit of arithmetic?
scrollHeight is the scrollable height. Subtract the element height from scrollHeight, and you get the value to scrollTo if you want to scroll to the end.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
16 May 2009 8:58 AM #3
If someone else wants that:
grid.view.mainBody.getHeight() - grid.view.scroller.getHeight() = x.view.scroller.getScroll().top
Thanks!LAMPE (Linux / Apache / MySQL / PHP / ExtJs)