Results 1 to 3 of 3

Thread: List shows empty items after changing store

  1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    32
    Answers
    2
    Vote Rating
    1
      0  

    Default Answered: List shows empty items after changing store

    How to reproduce:
    1. Load store with 40 items
    2. Scroll to position 20
    3. Reload store with 10 items

    The problem that list has offset of displayed items (topItemIndex). When the store is loaded, List call refresh and try to render items with offset (topItemIndex). But items with index more than 20 is not exist in store and list render empty items.

    There are 2 solutions:
    1) Do scrollTo up
    2) Set topItemIndex = 0

    Is there more better ways?

  2. I would use

    Code:
    list.getScrollable().getScroller().scrollToTop(false)

  3. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,892
    Answers
    3970
    Vote Rating
    1327
      0  

    Default

    I would use

    Code:
    list.getScrollable().getScroller().scrollToTop(false)
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  4. #3
    Sencha User
    Join Date
    May 2012
    Posts
    32
    Answers
    2
    Vote Rating
    1
      0  

    Default

    Ok. Thank for advice!

Posting Permissions

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