Baidaly,
Excellent, thanks! I changed it slightly because I had other panels with fewer than three objects in the header and was getting an error. Please close.
Ext.override(Ext.panel.Panel, {
createReExpander: function (direction, defaults) {
var me, isLeft, isRight, isVertical, result, icon, expandTool, title;
me = this;
isLeft = direction === 'left';
isRight = direction === 'right';
isVertical = isLeft || isRight;
result = Ext.apply({
hideMode: 'offsets',
title: me.title || '*',
titleAlign: me.titleAlign,
orientation: isVertical ? 'vertical' : 'horizontal',
textCls: me.headerTextCls,
icon: me.icon,
iconCls: me.iconCls,
glyph: me.glyph,
baseCls: me.self.prototype.baseCls + '-header',
ui: me.ui,
frame: me.frame && me.frameHeader,
ignoreParentFrame: me.frame || me.overlapHeader,
indicateDrag: me.draggable,
collapseImmune: true,
ownerCt: me.ownerCt,
ownerLayout: me.componentLayout,
margin: me.margin
}, defaults);
// If we're in mini mode, set the placeholder size to only 1px since
// we don't need it to show up.
if (me.collapseMode === 'mini') {
if (isVertical) {
result.width = 1;
} else {
result.height = 1;
}
}
// Create the re expand tool
// For UI consistency reasons, collapse:left reExpanders, and region: 'west' placeHolders
// have the re expand tool at the *top* with a bit of space.
if (!me.hideCollapseTool) {
if (isLeft || (isRight && me.isPlaceHolderCollapse())) {
// adjust the title position if the collapse tool needs to be at the
// top of a vertical header
result.titlePosition = 1;
}
result.titlePosition = 1;
result.tools = [{
xtype: 'tool',
type: 'expand-' + me.getOppositeDirection(direction),
uiCls: ['top'],
handler: me.toggleCollapse,
scope: me
}];
}
result = new Ext.panel.Header(result);
result.addClsWithUI(me.getHeaderCollapsedClasses(result));
if (result.items.length > 2) {
icon = result.items.items[0];
expandTool = result.items.items[2];
title = result.items.items[1];
result.items.items[0] = expandTool;
result.items.items[2] = icon;
}
return result;
}
});
[/QUOTE]