PDA

View Full Version : Horizontal Scrollbar caused by Vertical Scrollbar



dbeatle123
6 Oct 2010, 3:33 PM
Hi all,

It looks like Animal had fixed this issue (see http://www.sencha.com/forum/showthread.php?88153-solved-Ext-3.1-vertical-scroll) but I am still finding it in formPanels. Here is a simple example:

http://sybil.igs.umaryland.edu/scrollbar_ex.html

and here is the code:


Ext.onReady(function(){

var viewport = new Ext.Viewport({
layout: 'fit',
items: [
{xtype: 'form',
autoScroll: true,
items: [
{fieldLabel: 'foo1'},
{fieldLabel: 'foo2'},
{fieldLabel: 'foo3'},
{fieldLabel: 'foo4'},
{fieldLabel: 'foo5'},
{fieldLabel: 'foo6'},
{fieldLabel: 'foo7'},
{fieldLabel: 'foo8'},
{fieldLabel: 'foo9'},
{fieldLabel: 'foo10'},
{fieldLabel: 'foo11'},
{fieldLabel: 'foo12'}
]
}]
});
});


If you scroll up you will see that when the vertical scrollbar appears so does the horizontal.

Any thoughts on how to deal with this?

lucia_mgv
3 Nov 2010, 7:55 AM
The code you posted is working fine, not so the example. Is the same code??

Condor
3 Nov 2010, 8:07 AM
Why is the defaultType of FormPanel set to 'panel' on your server example? The default is textfield:

Ext.form.FormPanel.prototype.defaultType = 'textfield';

To avoid the horizontal scrollbar you could explicitly size the fields, e.g.

defaults: {anchor: '-' + Ext.getScrollBarWidth()}

yyogev
29 Nov 2010, 6:02 AM
Thanks, Condor!
I had the same problem and setting the anchor in the form defaults fixed it.