PDA

View Full Version : Component.setScrollable not working properly?



alanmies
28 Nov 2011, 4:35 AM
The above function is rather useless, if one is not able to use it. I have a panel that has "scrollable: true" in the config. When I call setScrollable(false), the scrolling is disabled. But after that calling setScrollable(true) does nothing, or at least the scrolling is not resumed. It seems this was a problem with 1.0 as well (http://www.sencha.com/forum/showthread.php?127622-setScrollable%28%29-Not-working-when-reset&highlight=setscrollable), but as 2.0 doesn't have doLayout(), any ideas how to get it to work?

mitchellsimoens
28 Nov 2011, 8:06 AM
Remember, we are still in PR stages. Expect bugs.
If you believe you have found a bug, post in the bugs forum.
The indicator works but the content isn't scrollable.



var panel = Ext.create('Ext.Panel', {
fullscreen : true,
scrollable : true,
html : 'Scroll me'
});

setTimeout(function() {
console.log('not scrollable');
panel.setScrollable(false);

setTimeout(function() {
console.log('scrollable');
panel.setScrollable(true);
}, 2000);
}, 2000);

rdougan
28 Nov 2011, 11:24 AM
This is a bug, and I have added a ticket for it.

GrowDigital
17 Dec 2011, 3:30 AM
Is there any way to work around this?

I have a panel with a carousel in a container, and another container with lots of text in it. The panel config sets scrollable to true.

The carousel has the following:




onDragStart : function (e) {
this.parent.parent.setScrollable(false);
this.callParent([e]);
},

onDragEnd : function(e) {
this.parent.parent.setScrollable(true);
this.callParent([e]);
console.log(this.parent.parent);
}



The onDragStart works (the panel is no longer scrollable) but the onDragEnd does not. How can I force the component to refresh and have scrollable true?

The console log object has scrollable : true in the config.

Calling this.parent.parent.setWidth(300); works but does not update the scrolling still.