PDA

View Full Version : 2 toolbars (top and bottom) in one region layout



krycek
26 Sep 2007, 9:50 AM
hi,
how can i put 2 toolbars in my region layout? one in the top and one in the bottom?

fay
26 Sep 2007, 10:15 AM
The following should work:

Create a BorderLayout (headerLayout) with north and center regions, add your contents panels for the two toolbars to these, and add headerLayout as a NestedLayoutPanel to the north region of your main layout:

//...

var headerLayout = new Ext.BorderLayout('my-header', {
// Toolbar 1
north: {split:false, initialSize: 25, titlebar: false, collapsible: false, fitToFrame: true, resizeEl: 'toolbar-1', fitContainer: true},
// Toolbar 2
center: {split:false, initialSize: 25, titlebar: false, collapsible: false, fitToFrame: true, resizeEl: 'toolbar-2', fitContainer: true}
});

headerLayout.add('north', new Ext.ContentPanel('toolbar-1'));
headerLayout.add('center', new Ext.ContentPanel('toolbar-2'));
//...
mainLayout.add('north', new Ext.NestedLayoutPanel(headerLayout));
//...

// HTML:

<!-- NORTH -->
<div id="my-header" class="x-layout-inactive-content"></div>
<div id="toolbar-1"></div>
<div id="toolbar-2"></div>

longracer
11 Oct 2007, 10:49 PM
=D>yes,it works. I also meet this problem, now it is OK.Thanks