-
27 Aug 2012 10:57 AM #1
Unanswered: Scrollable direction both not working
Unanswered: Scrollable direction both not working
I have a panel that loads some HTML. Until I figure out how to scale properly for different devices, I want to enable scrolling in both horizontal and vertical directions. I'm getting some very odd behavior (testing in Chrome on Win7):
'auto' & 'vertical': both scroll vertically mostly correctly, but if you keep pulling down, it seems to make the viewport smaller & begins to cut off the content
'horizontal': can't scroll vertically anymore, and scrolling horizontally doesn't work; it always bounces back to the left side.
'both': combination of 'vertical' and 'horizontal' behavior. Can scroll vertically, but attempting to scroll horizontally doesn't work (as described above).
The content I'm loading into my panel:
Chrome reports the computed style on "wrapper" as:PHP Code:var panel = Ext.create('Ext.Panel', {
type: 'vbox',
align: 'default',
scrollable: {
direction: 'horizontal'
},
html: [
"<a name=\"top\"></a>",
"<div id=\"vertical\"></div>",
"<div id=\"wrapper\" class=\"title_page\">",
...
"</div>",
"<a name=\"abs_bottom\"></a>"
].join("")
});
Ext.Viewport.add(panel);
As you can see, I have height & width set explicitly. Any ideas how to get this to work properly?PHP Code:-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-user-drag: none;
-webkit-user-select: none;
background-color: transparent;
background-image: none;
clear: both;
color: #464547;
display: block;
font-family: Arial, sans-serif;
font-size: 18px;
font-weight: bold;
height: 720px;
margin-bottom: 0px;
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
min-height: 0px;
min-width: 0px;
overflow-x: visible;
overflow-y: visible;
padding-bottom: 0px;
padding-left: 0px;
padding-right: 0px;
padding-top: 0px;
position: static;
width: 1024px;
-
29 Aug 2012 4:53 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
- Answers
- 3160
Working for me:
Removed the type and align configs as they are not valid configs of Ext.Panel.Code:var panel = Ext.create('Ext.Panel', { scrollable : { direction : 'both' }, width : 400, height : 400, items : [ { html : 'wide component', width : 600, height : 200 }, { html : 'tall component', height : 600 } ] }); Ext.Viewport.add(panel);Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
29 Aug 2012 5:03 AM #3
Thanks for replying.
Is it required to have a width and height set in the config in order for scrolling to work? Or can I set the same dimensions in CSS and have it still work properly?
-
29 Aug 2012 5:04 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
- Answers
- 3160
html can overflow the panel but one way or another the body needs to be wider than the component. I used static sizing to demonstrate that it does work.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.


Reply With Quote