如何在ExtJS中添加垂直滚动条

4
我使用extjs构建门户网站,并遇到以下问题。图像的高度超过选项卡(在右侧)。我想在此选项卡上添加垂直滚动条。在extjs中如何实现这一点?
这是我的代码的一部分:
   items: [{
                xtype: 'tabpanel',
                activeTab: 0,
                flex: 2,
                items: [{
                        xtype: 'panel',
                        title: 'Images',
                        items: [{contentEl:'img',autoScoll: true,height:11200,overflowY : String }]
                 },{    
                        xtype: 'panel',
                        title: 'Material',
                        items: [{contentEl:'msg',autoScoll: true,height:11200,overflowY : String }]
                        }]
            }]

谢谢。
4个回答

7
我在你的代码中看到了autoScoll,而不是autoScroll: true。 这似乎是一个笔误。 请检查一下。

你是对的。我看了30分钟感觉很愚蠢。高度有类似于autoheight的东西吗?谢谢。 - user1919
1
如果我没记错的话,你可以使用类似height:auto这样的东西。 - abarisone

4

尝试添加layout:fit和autoScroll:true。


2

2

对于ExtJS 6,您可以使用Ext.panel.Panel.scrollable

要启用垂直滚动,可以将其设置为scrollable: 'vertical'

要强制进行垂直滚动而不考虑内容,则可以传递Ext.scroll.Scroller配置:

scrollable: {
    y: 'scroll'
}

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接