PDA

View Full Version : [CLOSED] Why toolbar in 4 beta was above tabbar in tabpanel, but in 4 it`s under?



Rodion.Guschin
27 Apr 2011, 8:30 AM
Why toolbar in 4 beta was above tabbar in tabpanel, but in 4 it`s under?

mitchellsimoens
27 Apr 2011, 11:16 AM
I can confirm this but I personally think it's a more desirable look.


var tabpanel = Ext.create('Ext.tab.Panel', {
renderTo : Ext.getBody(),
dockedItems : [
{
xtype : 'toolbar',
dock : 'top',
items : [
{ text : 'Hello' }
]
}
],
items : [
{ xtype : 'container', title : 'One', html : 'One' },
{ xtype : 'container', title : 'Two', html : 'Two' }
]
});

Rodion.Guschin
27 Apr 2011, 10:30 PM
I'd prefer to have config option for this. Can I somehow extend Ext.tab.Panel (or/and other classes) to augment this look?

Rodion.Guschin
28 Apr 2011, 1:57 AM
Answering my own question :)
This new behaviour caused by new class hierarchy of Ext.tab.Bar. In 4 beta it was extension of Ext.panel.Panel, and in 4 release it become extension of Ext.panel.PanelHeader, which by default has weight = -1, which casue different sorting in method getDockedItems of Ext.panel.AbstractPanel. Hooray!
So this is the solution/hack - just extend TabPanel and change weight of tabBar for 1:


Ext.define('AM.view.CustomTabPanel',{
extend: 'Ext.tab.Panel',
alias: 'widget.CustomTabPanel',
initComponent: function() {
var me = this;
me.callParent(arguments);
me.tabBar.weight = 1;
}
});