PDA

View Full Version : Tabbar skipping my view.



justinKohactive
29 Nov 2011, 6:37 PM
If I setActiveItem on a view port and use the same view later in a tabbar, the tabbar skips my view and goes to the next item in the tabbar do i need to remove it first from the other viewport? if so how?

mitchellsimoens
30 Nov 2011, 8:21 AM
Not sure I follow 100%. I have tried this code with expected behavior:


var tabpanel = Ext.create('Ext.tab.Panel', {
fullscreen : true,
items : [
{
title : 'One',
html : 'one'
},
{
title : 'Two',
html : 'two'
},
{
title : 'Three',
html : 'three'
}
]
});

setTimeout(function() {
tabpanel.setActiveItem(1);

//manually switch to tab 3 after it switches to the 2nd tab
}, 1000);

setTimeout(function() {
tabpanel.setActiveItem(0);
}, 5000);

justinKohactive
30 Nov 2011, 9:11 AM
Its more like if i have

var viewport1 = new Ext.panel()

then a tabpanel

var viewport2 = new Ext.tabpanel({
items: [
view1,view2,view3
]});



then i try to attach view2 to viewport1,

viewport1.setActiveItem(view2);

when i try to access view2 from viewport2 via the tabbar it skips to view3.

rdougan
1 Dec 2011, 3:46 PM
You can't have the same view in 2 different containers. This will cause issues (like you are are experiencing).