PDA

View Full Version : [OPEN] TabPanel: defaults: closable true not configurable



Nickname
28 Jul 2011, 11:37 PM
REQUIRED INFORMATION


Ext version tested:


Ext 4.0.2a



Browser versions tested against:


Chromium 12.0.742.112 (90304) Ubuntu 10.10
FF4.0.1 (firebug 1.7 installed)



Description:


"closable" defaults are not applied, when adding a component (with Ext.create() or new Component) to TabPanel
using tabConfig in tabpanel defaults config causes wired effect with existing tabs (every tab has the same title)



Steps to reproduce the problem:
Use closable in defaults config object in TabPanel


configure a tabpanel
dont use a config object, insteand add initiated items to the tabpanel items config
example: items: [new Ext.panel.Panel(...)]
see testcase



using tabConfig in the defaults config of tabPanel


configure a tabpanel (3 items) with defaults config object has tabConfig Object with closable: true
all tabs have the title of tab 0 (activeItem)
see testcase



The result that was expected:


defaults configured in tabpanel config is applied



The result that occurs instead:


defaults are only applied on configured tabpanel items, that are not initiated components



Test Case 1 : With "closable: true" in defaults config of TabPanel



var tabs = Ext.createWidget('tabpanel', {
renderTo: 'tabs1',
width: 850,
activeTab: 0,
defaults :{
bodyPadding: 10,
closable: true
},
items: [{
contentEl:'script',
title: 'dont apply defaults, close false',
closable: false
},{
contentEl:'markup',
title: 'use defaults, close true',
},
new Ext.panel.Panel({
title: 'cfg panel 1, closable false',
closable: false
}),
new Ext.panel.Panel({
title: 'cfg panel 2, use defaults, close true'
})]
});

tabs.add(
new Ext.panel.Panel({
title: 'add1: dont apply defaults, close false',
closable: false
})
);
tabs.add(
new Ext.panel.Panel({
title: 'add2: apply defaults, close true',
})
);


Info for this testcase:
- the closable default is not applied, tried also Ext.create() instead of new "Component".
- what you should see: defaults are not applied


Test Case 1 : With "tabConfig: { closable: true}" in defaults config of TabPanel


var tabs = Ext.createWidget('tabpanel', {
renderTo: 'tabs1',
width: 850,
activeTab: 0,
defaults: {
tabConfig: {
closable: true
}
},
items:[{
title: 'config tab1'
}, {
title: 'something different than tab 1, but it will be overwritten'
}]
});


Ext.each(tabs.items.items, function(i) {
console.log(i.title, i.tab.text);
});

// output of Ext.each
//config tab1 config tab1
//something different than tab 1, but it will be overwritten config tab1


Info for this testcase:
- seems that the tab title is used from the first(activeTab?) tab for every tab
- closable is working
- tabs are not working anymore



HELPFUL INFORMATION

Debugging already done:


nothing that could help here



Possible fix:


not provided



Additional CSS used:


only default ext-all.css



Operating System:


Ubuntu 10.10

pierrocknroll
23 Dec 2011, 1:02 AM
I have the same problem...
I've "fixed" it with :


listeners:
{
beforeadd: function(oTabPanel, oPanel)
{
Ext.apply(oPanel,
{
closable: true
});
}
}

in my tabpanel...

keckeroo
6 Mar 2012, 12:06 PM
bump

[V4.1b3]

Adding to this ....

it appears many of the other fields within the newly created tab also get weird values ....

- new tab title is the same as the first tab in tabpanel
- when new tab(s) are clicked - first tab is always activated instead of clicked tab

however tab body is rendered correctly. So it appears that the problem just is with the
application of default values for tabConfig for each newly created tab which is added
to the tabPanel.

Kev

chramer
22 Aug 2014, 12:15 AM
still not fixed :-?