PDA

View Full Version : [FIXED] setScrollable(false) doesn't work



ryu1kn
26 Nov 2012, 9:10 PM
REQUIRED INFORMATION




Ext version tested:

Sencha Touch 2.1.0

Browser versions tested against:

Chrome 20 (Linux)

Description:

setScrollable(false) doesn't take effect once you do setScrollable(true)
Also tested with ST2.0.1.1 and it worked fine

Steps to reproduce the problem:

Set scrollable false after you set it true

The result that was expected:

Container is no longer scrollable

The result that occurs instead:

Container is still scrollable

Test Case:




Ext.define("ToggleScrollable.view.Main", {
extend: 'Ext.Panel',
fullscreen: true,
config: {
items: [{
xtype: 'actionsheet',
height: 150,
hideOnMaskTap: true,
items: [{
text: 'Do nothing'
}, {
text: 'Do nothing, either',
}]
}, {
xtype: 'button',
text: 'Show ActionSheet',
listeners: {
tap: function () {
this.up('panel').down('actionsheet').show();
}
}
}, {
xtype: 'button',
text: 'Toggle ActionSheet#scrollable',
state: false,
listeners: {
tap: function () {
var panel = this.up('panel'),
sheet = panel.down('actionsheet');
panel.setHtml('<div>set scrollable: ' + this.state + '</div>');
sheet.setScrollable(this.state);
this.state = !this.state;
}
}
}]
}
});







HELPFUL INFORMATION




Screenshot or Video:

none

See this URL for live test case: http://




Debugging already done:

none

Possible fix:

not provided

Additional CSS used:

only default ext-all.css

Operating System:

Linux

mitchellsimoens
27 Nov 2012, 6:01 AM
A better test case I have come up with:


Ext.Viewport.add({
xtype : 'panel',
items : [
{
xtype : 'button',
text : 'Toggle Scrollable (turn on)',
handler : function(btn) {
var panel = btn.up('panel'),
scrollable = panel.getScrollable(),
newScrollable = scrollable && !scrollable.getScroller().getDisabled() ? false : true;

panel.setScrollable(newScrollable);

btn.setText('Toggle Scrollable (turn ' + (newScrollable ? 'off' : 'on') + ')');
}
}
]
});

Testing in the code that will be 2.1.1 and this is now working so this is fixed for the next release.

ryu1kn
27 Nov 2012, 5:45 PM
Testing in the code that will be 2.1.1 and this is now working so this is fixed for the next release.

Alright. Thanks for the reply, mitchell.

intellix
11 Feb 2013, 3:42 AM
2.1.1 complains about requiring null instead of false

Neither of setScrollable(null) setScrollable(false) work on DataViews

hawkinbj
15 Jul 2013, 1:26 PM
That's fantastic that it's fixed in 2.1.1, but what's the fix for those on 2.1.0?

edit: for anyone else interested, the easiest solution is to just copy the source for Ext.Container from 2.1.1 into/over your existing src>touch Container.js