Results 1 to 4 of 4

Thread: How do I find the scroller for a specific component?

  1. #1
    Sencha User
    Join Date
    Sep 2011
    Location
    Boston
    Posts
    149
    Answers
    5
    Vote Rating
    7
      0  

    Default How do I find the scroller for a specific component?

    I have components on a Panel which has scroller.

    Sometimes the components are inside a FieldSet.

    Is there a simple way to find the scroller or do I have to crawl my way up the parents until I find something with a Scroller?

    Thanks
    David

  2. #2
    Sencha User jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Answers
    132
    Vote Rating
    101
      0  

    Default

    Do you create this Scroller (Ext.scroll.Scroller) manually or are you using the scrollable config for the Panel?

  3. #3
    Sencha User
    Join Date
    Sep 2011
    Location
    Boston
    Posts
    149
    Answers
    5
    Vote Rating
    7
      0  

    Default

    I'm using scrollable in the Panel config. The difficulty is that all I have to start with is the component.

    I ended up writing a routine to crawl up the parents which seems to work:
    Code:
            scrollIntoView: function (ctl) {
                var parent = ctl;
                var scrollable = null;
                // Find the scroller (if any).
                while (true) {
                    if (!parent.hasParent()) {
                        return;
                    }
                    parent = parent.parent;
                    if (!parent.isContainer) {
                        continue;
                    }
                    scrollable = parent.getScrollable();
                    // If the parent is a container and it is scrollable, we found it!
                    if (scrollable) {
                        break;
                    }
                }
                var scroller = scrollable.getScroller();
                ...
            }

  4. #4
    Sencha User jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Answers
    132
    Vote Rating
    101
      0  

    Default

    You should be able to use the .up('...') or .down('...') when you reference the component which basically runs up or down the list of components in use. I think you can search for the scroller that way. Read up on those functions from the docs. I would link it but it is taking too long to access them from my iPad right now.

Tags for this Thread

Posting Permissions

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