-
26 Nov 2012 3:34 AM #1
Unanswered: setScrollable(false) doesn't take effect once you do setScrollable(true)
Unanswered: setScrollable(false) doesn't take effect once you do setScrollable(true)
It seems you cannot set scrollable disabled once you do setScrollable(true). Please try the code below.
Is there any way that I can reset/initialise the scrollable setting but not just disabling it? (Like actionsheet.getScrollable().getScroller().setDisabled(true))
With the scrollable enabled, it looks like I've got to give the height so that the actionsheet doesn't get squashed. As it's hard to know how tall the height should be when i'm coding, I don't want to specify it.
Code: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>'); if (this.state) { sheet.setScrollable(this.state); } this.state = !this.state; } } }] } });
-
26 Nov 2012 3:43 AM #2
Oops sorry, it's just my fault.
Scrollable didn't get disabled because i had
Simply removing 'if' fixed the problemCode:if (this.state) { sheet.setScrollable(this.state); }
-
26 Nov 2012 9:41 PM #3
Alright, it would be a bit confusing because of my initial post with the test code that has unnecessary 'if', but I found out the problem does actually exist.
Removing 'if' works with ST2.0.1.1 but not with ST2.1.0.
For now, I do sheet.getScrollable().destroy() to make the sheet unscrollable.
Anyway, I've reported this to the Bugs forum.
-
26 Nov 2012 10:36 PM #4
You want to disable scroller ,why you set it false?scroller is a object ,not boolean value.
Code:if(sheet.getScrollable()){// if the scroller has been created sheet.getScrollable().getScroller().setDisabled(this.state); }else{ sheet.setScrollable(this.state); }I write English by translator.


Reply With Quote