0

我在视口中得到一个滚动条,我该如何删除它。

我知道这是一个奇怪的情况,因为在文档中我们有这个:

The Viewport does not provide scrolling, so child Panels within the Viewport 
should provide for scrolling if needed using the autoScroll config.

视口 sencha doc

我的视口:

Ext.define('MyViewport', {
   extend : 'Ext.container.Viewport',

   layout : 'border',
   padding : '5 5 5 5',
   defaults: {
       split: true,
       autoScroll : false
   },
   initComponent : function() {
       this.items = [{
         region: 'north',
         height: 70,
         width : '100%',
         split : false,
         padding : '0 0 5 0',
         items:[{
               //here some items
         }]
    },{
        region:'west',
        collapsible: true,
        width: 210,
        maxWidth : 210,
        autoScroll : false,
        items:[{
               //here some items
         }]
    },{
        region:'center',
        id : 'workspace',
        //here I add panels dynamically
    }];
    this.callParent(arguments);
      }
 });

我错过了什么吗?

4

1 回答 1

1

就像文档说的那样,视口永远不会自动将滚动条直接应用到它上面。

但是默认情况下,您的每个区域都是Ext.panel.Panel组件,它们会在溢出时自动获得滚动条。

尝试将layout: fit配置添加到您的视口。

如果这不能处理它,请将相同的配置添加到具有滚动条的面板组件中。

于 2012-05-25T21:05:22.233 回答