Results 1 to 4 of 4

Thread: Scroll to selected list item

  1. #1
    Sencha User das_ricardo's Avatar
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    16
    Vote Rating
    3
      0  

    Default Scroll to selected list item

    Hello,

    can someone tell me how to scroll to a selected list item? I searched with google and in this forum but nothing works. My list store is grouped, filtered and sorted.

    So thank's for any reply

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    Try something like:

    Code:
    var scroller = list.getScrollable().getScroller(),
        index    = store.indexOf(record);
    
    scroller.stopAnimation();
    
    var containerSize = scroller.getContainerSize().y,
        size          = scroller.getSize().y,
        maxOffset     = size - containerSize,
        offsetTop     = list.getItemMap().map[index],
        offset        = (offsetTop > maxOffset) ? maxOffset : offsetTop;
    
    scroller.scrollTo(0, offset);
    if (list.updatedItems.length > 0 && (!list.scheduledTasks || list.scheduledTasks.length === 0)) {
        list.refreshScroller();
    }
    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

  3. #3
    Sencha User
    Join Date
    May 2016
    Posts
    7
    Vote Rating
    0
      0  

    Default Hey

    Its dont work for me

  4. #4
    Sencha User
    Join Date
    May 2016
    Posts
    7
    Vote Rating
    0
      0  

    Default

    what is a list that you use

Posting Permissions

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