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 config
for declaring the panel.
Asked
Active
Viewed 3.3k times
13

Vadzim
- 24,954
- 11
- 143
- 151

Soham Dasgupta
- 5,061
- 24
- 79
- 125
-
1I wonder why, if you don't want to display a title, you set it in the first place... – VoidMain Nov 24 '11 at 18:39
3 Answers
23
Use either the header
or headerAsText
config option of panel to hide its title. From ExtJS API documentation:
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.
and
headerAsText : Boolean
true to display the panel title in the header, false to hide it (defaults to true).

Tommi
- 8,550
- 5
- 32
- 51
-
4With ExtJS 4.x, header:Boolean is now preventHeader:Boolean. http://docs.sencha.com/ext-js/4-0/#!/api/Ext.panel.Panel-cfg-preventHeader – clint Oct 25 '12 at 13:21
-
For the benefit of Sencha Architect 2 users the 'header' property is the only one available in the standard property list for the Panel widget. It still works in 4.x, however you can just enter preventHeader as a 'custom' property using the property "add" button in Architect. This also works, and will be more future proof. – Glenn Lawrence May 30 '14 at 22:32
-
4
Use preventHeader property. I checked it and it's worked
See example below
Ext.widget('panel', {
title: 'Panel header will not be shown',
preventHeader: true,
width: 300
});

Gregory Nozik
- 3,296
- 3
- 32
- 47
1
You can just use the config
Ext.panel.Panel({
// title: 'Test', to neglet this
header:false,
tools: [{
type: 'refresh'
}, {
type: 'help'
}],
});