PDA

View Full Version : [CLOSED] tabConfig in Ext.tab.Panel defaults breaks tabpanel's functionality



sarimarton
10 Dec 2013, 3:52 AM
tabConfig in Ext.tab.Panel defaults breaks tabpanel's functionality. This bug is highly related to http://www.sencha.com/forum/showthread.php?244600, but that one is closed, and discussion there went to irrelevant directions (like how to use shared xtypes etc.)

Ext version tested:
Ext 4.2.1

Browser versions tested against:
Chromuim Version 30.0.1599.114 Ubuntu 12.04 (30.0.1599.114-0ubuntu0.12.04.3)
FF 25.0.1 (firebug 1.12.5 installed)

DOCTYPE tested against:
html

Description:
Using tabConfig in tab panel's defaults property makes tabs titled with the same text, and tabs except the first can't be clicked.

Ext.tab.Panel's defaults is for sharing attributes among tabs. Sharing tabConfig: { flex: 1 } among tabs should be done by using Ext.tab.Panel's defaults: { tabConfig: { flex: 1 } }. This produces the bug.

This patch fixes the bug:

Ext.define('Ext.tab.Panel', {
...
onAdd: function(item, index) {
...
-cfg = item.tabConfig || {},
+cfg = item.tabConfig ? Ext.clone(item.tabConfig) || {},

Steps to reproduce the problem:
http://jsfiddle.net/wQGY2/

The result that was expected:
I have 2 tabs: "AAA" and "BBB"

The result that occurs instead:
I have two "AAA" tabs.

sarimarton
11 Dec 2013, 3:16 AM
Fiddle updated: https://fiddle.sencha.com/#fiddle/227

Actually Object.create is enough instead of Ext.clone. Tabs just need a new reference inherited from the common tabConfig.

Gary Schlosberg
11 Dec 2013, 9:12 AM
Thanks for the report! I have opened a bug in our bug tracker.