View Full Version : Horizontal Scrollbar caused by Vertical Scrollbar

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:


and here is the code:


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?

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

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()}

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