Results 1 to 3 of 3

Thread: Automatic Scrolling Grid

  1. #1
    Sencha Premium Member ethraza's Avatar
    Join Date
    Jun 2007
    Location
    Brazil
    Posts
    378
    Vote Rating
    9
      0  

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

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,760
    Vote Rating
    83
      0  

    Default

    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.
    Longtime Sencha engineer. Now surplus to requirements apparently...

  3. #3
    Sencha Premium Member ethraza's Avatar
    Join Date
    Jun 2007
    Location
    Brazil
    Posts
    378
    Vote Rating
    9
      0  

    Default

    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)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •