Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.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 从Ext.TabPanel隐藏项目_Extjs - Fatal编程技术网

Extjs 从Ext.TabPanel隐藏项目

Extjs 从Ext.TabPanel隐藏项目,extjs,Extjs,当我点击一个按钮时,我需要从选项卡面板隐藏编辑工具栏 这是我的选项卡面板: Ext.onReady(function(){ mainimgwidth = $("#imgMain").prop("width"); tabpanel = new Ext.TabPanel({ activeTab: 0, deferredRender:false, items: [ {

当我点击一个按钮时,我需要从选项卡面板隐藏编辑工具栏

这是我的选项卡面板:

Ext.onReady(function(){
       mainimgwidth = $("#imgMain").prop("width");
       tabpanel = new Ext.TabPanel({
           activeTab: 0,
           deferredRender:false,
           items: [
               {

                  title : '${tr.File}',
                  items : [
                      fileTlb
                  ]
               },
               {
                  id: 'editToolbar',
                  title: '${tr.Edit}',
                  items : [
                      editTlb
                  ]
               },
               { 
                  title: '${tr.Review}'
               }
           ]
       });
我试过了,但没有成功:

function remove(){
       var edit = tabpanel.getComponent('editToolbar');
       edit.setVisible(false);
    }
我还尝试使用:edit.hide()

这是“编辑”工具栏:

var editTlb = new Ext.Toolbar({ 
            id:'edit_tlb',
            items:[
                new Ext.Toolbar.Button({
                         id:'btn_rotate_right',
                         iconCls: 'icon_rotate_right'
                         }),
                new Ext.Toolbar.Button({
                         id:'btn_rotate_left',
                         iconCls: 'icon_rotate_left'
                         }),
                new Ext.Toolbar.Button({
                         id:'btn_rotate_vertical',
                         iconCls: 'icon_rotate_vertical'
                         })
        ]
});

我相信你正在寻找的方法,这将隐藏工具栏。要再次显示工具栏,请使用该方法

您可能看到的另一个选项是禁用/启用,这将禁用
工具栏,但仍然可见。

使用edit.tab.show()和edit.tab.hide()

有关Ext docs中的示例,请参见上的答案。

可能重复的