PDA

View Full Version : [CLOSED] TabPanel example not work



JCarlosF
Mar 08, 2013, 12:17 AM
the Example of link http://examples2.ext.net/#/TabPanel/Basic/Show_Hide/ does not work,
Why?

specifically the button "Show tab6" does not work

and I need to do something similar in my project
thanks

Baidaly
Mar 08, 2013, 12:44 AM
Hello!

Thank you! We are investigating.

Temporarily, use the following overriding:



<script>
Ext.override(Ext.tab.Panel, {
addTab : function (tab, index, activate) {
if (tab.id && this.getComponent(tab.id) && tab.isVisible()) {
return;
}

var config = {};

if (!Ext.isEmpty(index)) {
if (typeof index == "object") {
config = index;
} else if (typeof index == "number") {
config.index = index;
} else {
config.activate = index;
}
}

if (!Ext.isEmpty(activate)) {
config.activate = activate;
}

if (this.items.getCount() === 0) {
this.activeTab = null;
}

if (tab.hidden && Ext.isFunction(tab.show)) {
tab.show();
}

if (!Ext.isEmpty(config.index) && config.index >= 0) {
tab = this.insert(config.index, tab);
} else {
tab = this.add(tab);
}

if (config.activate !== false) {
this.setActiveTab(tab);
this.tabBar.setActiveTab(tab.tab);
}
}
});
</script>

Daniil
Mar 08, 2013, 1:51 PM
Hello,

It is rather a bug in the example, not in the addTab method.

We corrected the sample. Now the Tab6 is added into the Bin collection, not into the Items. Please look at the corrected sample.
http://examples2.ext.net/#/TabPanel/Basic/Show_Hide/

JCarlosF
Mar 08, 2013, 4:07 PM
Hello,

It is rather a bug in the example, not in the addTab method.

We corrected the sample. Now the Tab6 is added into the Bin collection, not into the Items. Please look at the corrected sample.
http://examples2.ext.net/#/TabPanel/Basic/Show_Hide/

perfect, this works correctly, thanks