Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Extjs:面板内的工具栏在浏览器调整大小时不调整大小_Extjs_Resize_Extjs4.1_Toolbar_Gridpanel - Fatal编程技术网

Extjs:面板内的工具栏在浏览器调整大小时不调整大小

Extjs:面板内的工具栏在浏览器调整大小时不调整大小,extjs,resize,extjs4.1,toolbar,gridpanel,Extjs,Resize,Extjs4.1,Toolbar,Gridpanel,我在一个面板中有一个工具栏和一个网格。在调整大小时,网格看起来很好。但是,工具栏将保持其原始尺寸,并且不会调整大小,从而隐藏一些按钮。 我如何纠正这一点 { xtype: 'panel', region: 'center', layout: 'border', tbar:[ { x

我在一个面板中有一个工具栏和一个网格。在调整大小时,网格看起来很好。但是,工具栏将保持其原始尺寸,并且不会调整大小,从而隐藏一些按钮。 我如何纠正这一点

{
                xtype: 'panel',
                region: 'center',
                layout: 'border',
                tbar:[
                    {

                        xtype: 'buttongroup',
                        region: 'center', 
                        items:  getToolBarButtons()      // method to add buttons to toolbar dynamically
                    }
                ],
                items: [
                    {
                        xtype: 'tabpanel',
                        activeTab: 0,
                        layout: 'fit',
                        region: 'center',
                        disabled: 'true',
                        items:[
                            {
                                // grid 1
                                height : '80%',
                                width : '100%'
                            },
                            {
                                // grid 2
                                height : '80%',
                                width : '100%'
                            }
                        ]
                    }
                ]
            }
编辑


我将
tbar
替换为
dockditems:[{xtype:'toolbar'…}]
。工具栏根本不会被渲染。工具栏可以自动将溢出的工具栏按钮转换为带有菜单项的菜单。要允许这种自动转换,您需要使用config配置
工具栏
组件

因此,不要使用
tbar
config:

dockedItems: [{
   xtype: 'toolbar',
   dock: 'top',
   enableOverflow: true,
   items: [
      {
          xtype: 'buttongroup',                 
          items:  getToolBarButtons()
      }
   ]
}]

还考虑将按钮划分为多个按钮组。若工具栏有更多的按钮组,ExtJS工具栏可以更好地处理溢出


摆弄实例:

我尝试了
enableOverflow:true
用于
tbar
。我没有看到溢出菜单。该行为是否与作为
dockditems
而不是
tbar
编写有关?是的。使用
tbar:[]
您只能在工具栏中定义项,而不能在工具栏配置中定义项。因此,您应该对
dockditems
使用完整的定义,正如我在回答中所显示的(正如您在文档中所读到的
tbar
只是
dockditems:[{xtype:'toolbar',dock:'top',…
)参考我之前的编辑,我将
tbar
替换为
dockditems:[{xtype:'toolbar'.}]
。工具栏不会在allI setup fiddle with live example中呈现:布局与您的问题相同。工具栏在
dockedItems
配置中定义,您可以看到它已呈现,溢出管理正在工作。现在工作正常。非常感谢!