PDA

View Full Version : [DUPE][3.??] setActiveGroup in GroupTabPanel Bug



manacleto
8 Jan 2010, 9:35 PM
see below

manacleto
8 Jan 2010, 9:38 PM
see below

manacleto
8 Jan 2010, 9:41 PM
The setActiveGroup of GroupTabPanel does not seem to behave as I expect. I modified the GroupTabs sample/demo included in the ext3.1 package (samples) by adding a link "Click this to activate Configuration Group Tab" (screen snapshot of the modified GroupTabs sample attached)

When the link is clicked, the target GroupTab is activated but it shows a blank view. I am attaching the screen snapshot.

What I expect is that the Configuration GroupTab is activated and the view with sample text "Lorem ipsum" will appear.

This is the code of the modified GroupTabs Demo (grouptabs.js):


/*!
* Ext JS Library 3.1.0
* Copyright(c) 2006-2009 Ext JS, LLC
* licensing@extjs.com
* http://www.extjs.com/license
* @modified manacleto 01092010 - to confirm setActiveGroupbug
*/
var viewport;
function callTest(){
viewport.findById('main').setActiveGroup('item2');
}

Ext.onReady(function() {
Ext.QuickTips.init();

// create some portlet tools using built in Ext tool ids
var tools = [{
id:'gear',
handler: function(){
Ext.Msg.alert('Message', 'The Settings tool was clicked.');
}
},{
id:'close',
handler: function(e, target, panel){
panel.ownerCt.remove(panel, true);
}
}];



viewport = new Ext.Viewport({
layout:'fit',
items:[{
xtype: 'grouptabpanel',
tabWidth: 130,
id:'main',
activeGroup: 0,
items: [{
mainItem: 1,
items: [{
title: 'Tickets',
layout: 'fit',
iconCls: 'x-icon-tickets',
tabTip: 'Tickets tabtip',
style: 'padding: 10px;',
items: [new SampleGrid([0,1,2,3,4])]
},
{
xtype: 'portal',
title: 'Dashboard',
tabTip: 'Dashboard tabtip',
items:[{
columnWidth:.33,
style:'padding:10px 0 10px 10px',
items:[{
title: 'Grid in a Portlet',
layout:'fit',
tools: tools,
items: new SampleGrid([0, 2, 3])
},{
title: 'Another Panel 1',
tools: tools,
html:"<a href='#' onClick='javascript:callTest()'>Click this to activate Configuration Group Tab</a>"
}]
},{
columnWidth:.33,
style:'padding:10px 0 10px 10px',
items:[{
title: 'Panel 2',
tools: tools,
html: Ext.example.shortBogusMarkup
},{
title: 'Another Panel 2',
tools: tools,
html: Ext.example.shortBogusMarkup
}]
},{
columnWidth:.33,
style:'padding:10px',
items:[{
title: 'Panel 3',
tools: tools,
html: Ext.example.shortBogusMarkup
},{
title: 'Another Panel 3',
tools: tools,
html: Ext.example.shortBogusMarkup
}]
}]
}, {
title: 'Subscriptions',
iconCls: 'x-icon-subscriptions',
tabTip: 'Subscriptions tabtip',
style: 'padding: 10px;',
layout: 'fit',
items: [{
xtype: 'tabpanel',
activeTab: 1,
items: [{
title: 'Nested Tabs',
html: Ext.example.shortBogusMarkup
}]
}]
}, {
title: 'Users',
iconCls: 'x-icon-users',
tabTip: 'Users tabtip',
style: 'padding: 10px;',
html: Ext.example.shortBogusMarkup
}]
}, {
expanded: true,
id:"item2",
items: [{
title: 'Configuration',
iconCls: 'x-icon-configuration',
tabTip: 'Configuration tabtip',
style: 'padding: 10px;',
html: Ext.example.shortBogusMarkup
}, {
title: 'Email Templates',
iconCls: 'x-icon-templates',
tabTip: 'Templates tabtip',
style: 'padding: 10px;',
html: Ext.example.shortBogusMarkup
}]
}]
}]
});

});

manacleto
13 Jan 2010, 1:57 AM
modified the callTest function, added a setActiveTab(...) call:


function callTest(){
viewport.findById('main').setActiveGroup('item2');
viewport.findById('main').findById('item2').setActiveTab('item2b');
}



set an id on the first group item:


{
expanded: true,
id:"item2",
items: [{
title: 'Configuration',
iconCls: 'x-icon-configuration',
id:'item2b',
tabTip: 'Configuration tabtip',
style: 'padding: 10px;',
html: Ext.example.shortBogusMarkup
}, {
title: 'Email Templates',
iconCls: 'x-icon-templates',
tabTip: 'Templates tabtip',
style: 'padding: 10px;',
html: Ext.example.shortBogusMarkup
}]
}]


I am not sure if this is the right way to do it or if indeed it was a bug on setActiveGroup

hendricd
13 Jan 2010, 6:39 AM
@manacleto--
I believe this has already been resolved here (http://www.extjs.com/forum/showthread.php?t=87991).

pyrat
16 Feb 2010, 12:30 AM
I do not think this is a duplicate as the fix which has been integrated into 3.1.1 does not resolve the issue of programmatically changing groups and tabs which you have not already visited.

The fix described above does fix the problem, but there must be an underlying fix to setActiveGroup which is required.

Jamie Avins
16 Feb 2010, 9:02 AM
I do not think this is a duplicate as the fix which has been integrated into 3.1.1 does not resolve the issue of programmatically changing groups and tabs which you have not already visited.

The fix described above does fix the problem, but there must be an underlying fix to setActiveGroup which is required.

Sorry, I don't follow what you are trying to say here.