Javascript 隐藏 ExtJS 面板标题

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3004444/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-23 02:51:35  来源:igfitidea点击:

Hide ExtJS Panel Title

javascriptextjstitle

提问by Soham Dasgupta

I have a ExtJS panel inside a viewport center region. I want to hide the title of the panel. How can I do it? I'm using xtype configfor declaring the panel.

我在视口中心区域内有一个 ExtJS 面板。我想隐藏面板的标题。我该怎么做?我xtype config用于声明面板。

回答by Tommi

Use either the headeror headerAsTextconfig option of panel to hide its title. From ExtJS API documentation:

使用面板的headerheaderAsText配置选项来隐藏其标题。来自ExtJS API 文档

header : Boolean

true to create the Panel's header element explicitly, false to skip creating it. If a title is set the header will be created automatically, otherwise it will not. If a title is set but header is explicitly set to false, the header will not be rendered.

标头:布尔值

true 显式创建面板的标题元素,false 跳过创建它。如果设置了标题,将自动创建标题,否则不会。如果设置了标题但标题明确设置为 false,则不会呈现标题。

and

headerAsText : Boolean

true to display the panel title in the header, false to hide it (defaults to true).

headerAsText : 布尔值

true 在标题中显示面板标题,false 隐藏它(默认为 true)。

回答by Gregory Nozik

Use preventHeader property. I checked it and it's worked

使用 preventHeader 属性。我检查了它并且它起作用了

See example below

请参阅下面的示例

Ext.widget('panel', {
        title: 'Panel header will not be shown',
        preventHeader: true,
        width: 300

    });

回答by Gregory Nozik

You can just use the config

你可以只使用配置

Ext.panel.Panel({
    // title: 'Test',   to neglet this
    header:false,
    tools: [{
        type: 'refresh'
    }, {
        type: 'help'
    }],
});

"header:false config documentation"

“header:false 配置文档”