-
14 Nov 2012 7:31 AM #1
Answered: List in scrollable View - double scrolling issue
Answered: List in scrollable View - double scrolling issue
Hi,
basically i got a list as a childitem in a scrollable panel/container.
Both scroll vertically, which means when i scroll up/down outside of the list the view itself scrolls just fine.
Now the problem is, if i scroll "inside" the list it still also scrolls my view up and down, which is absolutely irritating.
To get a better idea of my view I attached a screenshot:
ListInScrollableView.PNG
Can you guys give me any hint how to tackle that problem?
I simply want to only scroll the list (but not the view) when scrolling inside the list component and when I scroll outside the list component the view itself should get scrolled,
any help is appreciated,
regards Antares
-
Best Answer Posted by AntaresDaha
Thanks to your suggestion i was able to come around with a solution.
Although I did search for something like a "scroller" of my list I wasn't able to find one initially, but
there actually is a scroller object, controlling the list's (+ one for the view's) scrolling, which you can get via mylist.getScrollable().getScroller() - notice getScrollable does not simply return a boolean a suggested by the documentation but a "complex" view/object containing a scroller.
The solution I came up with was basically like Stx.Greg suggested, enabling/disabling the parents scrolling behavious in the sublist's evemt handlers for srollstart and scrollend:
Thank you very much, regardsCode:dispatcherview:{ initialize: function(){ this.getDispatcherStaffList().getScrollable().getScroller().on('scrollend', function() { Ext.getCmp('dispatcherview').getScrollable().getScroller().setDisabled(false); }); this.getDispatcherStaffList().getScrollable().getScroller().on('scrollstart', function() { Ext.getCmp('dispatcherview').getScrollable().getScroller().setDisabled(true); }); this.getDispatchervDevelopertasksList().getScrollable().getScroller().on('scrollend', function() { Ext.getCmp('dispatcherview').getScrollable().getScroller().setDisabled(false); }); this.getDispatchervDevelopertasksList().getScrollable().getScroller().on('scrollstart', function() { Ext.getCmp('dispatcherview').getScrollable().getScroller().setDisabled(true); }); } },
-
14 Nov 2012 11:47 AM #2
If you add an event handler on 'scrollstart' and 'scrollend' on the list's scroller, you can disable the parent container's scroller on scrollstart and then enable it again on scrollend.
-
15 Nov 2012 7:56 AM #3
solved.
solved.
Thanks to your suggestion i was able to come around with a solution.
Although I did search for something like a "scroller" of my list I wasn't able to find one initially, but
there actually is a scroller object, controlling the list's (+ one for the view's) scrolling, which you can get via mylist.getScrollable().getScroller() - notice getScrollable does not simply return a boolean a suggested by the documentation but a "complex" view/object containing a scroller.
The solution I came up with was basically like Stx.Greg suggested, enabling/disabling the parents scrolling behavious in the sublist's evemt handlers for srollstart and scrollend:
Thank you very much, regardsCode:dispatcherview:{ initialize: function(){ this.getDispatcherStaffList().getScrollable().getScroller().on('scrollend', function() { Ext.getCmp('dispatcherview').getScrollable().getScroller().setDisabled(false); }); this.getDispatcherStaffList().getScrollable().getScroller().on('scrollstart', function() { Ext.getCmp('dispatcherview').getScrollable().getScroller().setDisabled(true); }); this.getDispatchervDevelopertasksList().getScrollable().getScroller().on('scrollend', function() { Ext.getCmp('dispatcherview').getScrollable().getScroller().setDisabled(false); }); this.getDispatchervDevelopertasksList().getScrollable().getScroller().on('scrollstart', function() { Ext.getCmp('dispatcherview').getScrollable().getScroller().setDisabled(true); }); } },
-
28 Nov 2012 8:06 AM #4
You already found a solution that works for you, but I just wanted to mention (for anyone else who's having issues as well) that for me, setting the list to be scrollable only horizontally seems to have the same effect:
I should also note that in ST 2.0.1, the "scrollable: false" config setting was sufficient to get my child list to not double-scroll, but in 2.1 it appears to ignore that directive and scroll anyway unless I set the scroller as above.Code:config: { ... scrollable: { direction: 'horizontal', directionLock: true } ... }


Reply With Quote