Hybrid View
-
12 Nov 2012 3:58 PM #1
Unanswered: How do I find the scroller for a specific component?
Unanswered: 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
-
13 Nov 2012 6:02 AM #2
Do you create this Scroller (Ext.scroll.Scroller) manually or are you using the scrollable config for the Panel?
-
13 Nov 2012 6:11 AM #3
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(); ... }
-
13 Nov 2012 7:47 AM #4
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.


Reply With Quote