PDA

View Full Version : [FIXED] Ext.tab.Panel - reording tabs



joostvanhassel
23 Mar 2012, 7:45 AM
If you have a tabpanel with several tabs on it and you move the last tab to another position, the tabpanels 'Active Item' will be set to the tab count (which, as it is a zero based property, does not exist). As far as I've seen, this does not occur when moving tabs other than the last tab.

aconran
23 Mar 2012, 11:27 AM
Could you explain how to reproduce this?

joostvanhassel
23 Mar 2012, 11:41 AM
start a new project
drag a tabpanel to designer, so your code will look like:



Ext.define('MyApp.view.MyTabPanel', {
extend: 'Ext.tab.Panel',

config: {
tabBar: {
docked: 'top'
},
items: [
{
xtype: 'container',
title: 'Tab 1'
},
{
xtype: 'container',
title: 'Tab 2'
},
{
xtype: 'container',
title: 'Tab 3'
}
]
}
});



In the project inspector, drag 'Tab 3' to a new location, for example between Tab 1 and Tab 2
the code now looks as below (activeItem set to 3, while there is no container at index 3)



Ext.define('MyApp.view.MyTabPanel', {
extend: 'Ext.tab.Panel',

config: {
activeItem: 3,
tabBar: {
docked: 'top'
},
items: [
{
xtype: 'container',
title: 'Tab 1'
},
{
xtype: 'container',
title: 'Tab 3'
},
{
xtype: 'container',
title: 'Tab 2'
}
]
}
});


I reproduced this using build 311

aconran
23 Mar 2012, 11:44 AM
Thanks, I see what the issue is.

At one point in time we only had tabs as direct children. Now we have the tabBar there. It is incorrectly counting the tabBar as an item. We will fix this, thanks for the bug report.

joostvanhassel
23 Mar 2012, 12:04 PM
Great, thanks.
It's not really a showstopper as it's easily fixed, but I can imagine it might take some time before people notice it.

Keep up the good work!

joostvanhassel
23 Mar 2012, 12:35 PM
One more though on this: I'm not sure if this is just a counting error, as the expected behaviour is not the 'new last tab' to be the active item after the reordering, the tab that was the active item before the reordering is.

aconran
4 Apr 2012, 10:25 PM
This will be fixed in the next build > 360.