PDA

View Full Version : [FIXED-107] Ext.TabPanel doLayout()



mrsunshine
25 Jun 2010, 8:29 AM
In Ext.TabPanel the doLayout() function is needed, cause otherwise if you add() a new item afterrender, the TabBar will not update and the new tab is not rendered.

It works if you add the doLayout to Ext.TabPanel:



doLayout: function() {
Ext.TabPanel.superclass.doLayout.call(this);
this.getTabBar().doLayout();
}

tubamanu
27 Jun 2010, 1:40 AM
hi,

has anyone tested this solution? in my small demo application this fix is not working.....maybe i will wait for the next release....

mrsunshine
27 Jun 2010, 1:52 AM
Yes, I tested it. How did you use it in your application? Post some code maybe i can help you

tubamanu
27 Jun 2010, 1:59 AM
i used it as u descriped in the thread one day ago....
my code is this.....



cf.Main = function(){return {

theTabPanel :false,
theFirstTab :false,
theSecondTab :false,

init: function () {
this.initSecondTab();
this.initFirstTab();
this.initTabPanel();
this.theTabPanel.add(this.theFirstTab);
this.theTabPanel.add(this.theSecondTab);
this.theTabPanel.doLayout();
},


initSecondTab: function () {
this.theSecondTab = new Ext.Panel({
title: 'Tab Nr. 2'
});
},


initFirstTab: function () {
this.theFirstTab = new Ext.Panel({
title: 'Tab Nr. 1'
});
},


initTabPanel: function () {
this.theTabPanel = new Ext.TabPanel({
fullscreen: true,
animation: 'slide',
doLayout: function() {
Ext.TabPanel.superclass.doLayout.call(this);
this.getTabBar().doLayout();
}
});
}

};}();