PDA

View Full Version : Viewport with toolbar



Stephan123
19 Aug 2009, 3:22 AM
Hello !

I have an viewport with layout: 'border'.
The problem is the toolbar in the 'north' region.
I can't see the toolbar.
What is wrong ?


var layout = new Ext.Viewport({
layout : "border",
frame: true,
items : [{
region : "center",
title : "Domainverwaltung"
},{
region : "north",
id: 'navigation',
title: 'Navigation',
items: [{
xtype: 'toolbar',
items: [{
xtype: 'tbbutton',
text: 'Text'
}]
}]
},{
region : "west",
width : 250,
collapsible : true,
split : true,
items: [{
xtype: 'panel',
title: 'Kalender',
height: 300
},{
xtype: 'tabpanel',
title: 'Bereiche',
items: [{
title: 'Domain'
},{
title: 'Kundenname'
},{
title: 'SysCP'
}]
}]
},{
region : "east",
collapsible: true,
width : 300,
split : true,
title : "Nervliste"
}]
}); // Ende Layout

Greetings

Stephan

Condor
19 Aug 2009, 3:24 AM
1. A north region needs a height.
2. Wouldn't it be better to use tbar instead of items?

Animal
19 Aug 2009, 4:12 AM
Really the north should just be a Toolbar.

Lukman
19 Aug 2009, 5:59 AM
Viewport doesn't have a toolbar. It's not a Panel. So, you either need to use a layout and add a toolbar as an item (like the OP is doing), or add a panel to the viewport (overnest?) to add the toolbar using the tbar option.

Animal
19 Aug 2009, 6:06 AM
Just use a Toolbar configured with region: 'north' as an item.

It's simple.

Lukman
19 Aug 2009, 6:09 AM
Just use a Toolbar configured with region: 'north' as an item.

It's simple.
And we don't need to specify height? Is there any auto-height magic involved when a toolbar is the north region of a borderlayout?

Animal
19 Aug 2009, 6:11 AM
Should work as long as the Toolbar is not empty.

oburlaca
8 Sep 2009, 6:40 AM
It seems there is a bug with a north toolbar. (At least in ext2.2 it worked) The following simple example shows that the top toolbar doesn't display. If I use "autoHeight: true", the toolbar will appear after a browser resize, otherwise it will not appear at all. If I issue a "viewPort.doLayout();" after its creation, than it's ok. .... the doLayout doesn't help when autoHeight: false.

example: http://www.burlaca.com/test/

skabbit
8 Sep 2009, 9:01 AM
I have the same problem: toolbar in north do not get proper height after render.
And, the same solution: I simply call Viewport.doLayout() after creation.