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 User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Answers
    3976
    Vote Rating
    1382
      0  

    Default

    I would use

    Code:
    list.getScrollable().getScroller().scrollToTop(false)
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    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
  •