PDA

View Full Version : How to remove a GroupTabPanel?



astuteq
15 Feb 2011, 6:24 AM
Hello,

I have a problem when I try to remove a GroupTabPanel.
When I do "parent.remove(grouptabpanel)" only one TabItem is removed and the I get the error:

"Result of expression 'item' [undefined] is not an object., ux-all-debug.js:4168"

How can I remove the complete TabPanel?

Here is my code:


{
xtype: 'button',
id: 'grouptab-btn',
text: 'GroupTab',
toggleGroup: 'menu',
enableToggle: true,
handler: function (b, e){

var center = Ext.getCmp('center-div');
//remove GrouptabPanel from center-div
center.remove('center');
center.setTitle(' ');

if (b.pressed == true) {
center.setTitle('GroupTab');
//add GrouptabPanel to center-div
center.add({
id: 'center',
border: false,
layout: 'fit',
autoScroll: true,
items: [
{
xtype: 'grouptabpanel',
tabWidth: 130,
activeGroup: 0,
items: [
{
items:[
{
title: 'Dashboard',
html: 'Dashboard',
style: 'padding: 10px;',
}
]
},
{
items: [
{
title: 'Configuration',
style: 'padding: 10px;',
html: 'Configuration'
}
]
}
]
}
]
}
);
}
center.doLayout();
}
}


Here is how it looks like:

24701
24700

jsakalos
15 Feb 2011, 4:10 PM
Try to remove the group tab from Firebug/Web Inspector console and if it still fails I'd classify it as a bug.

Update: I've tried to remove GroupTabPanel from the Viewport at http://dev.sencha.com/deploy/dev/examples/grouptabs/grouptabs.html by typing
Ext.getCmp('ext-comp-1004').remove(0) in WI console and I got the error
TypeError: Result of expression 'item' [undefined] is not an object. that is what you're getting too.

Moving this thread to bugs.

astuteq
16 Feb 2011, 1:47 AM
Ext.getCmp('center').remove(0) shows me the same error. I have worked around it by using a card layout, I think I can work with this.

Many thanks!

BTW: I'm using Safari on Mac OS X to write to the forum. It seems that using the button "Preview Post" does not preview, but submit the reply! I will post this reply by using the "Preview Post" button, too. ;)