PDA

View Full Version : Issuewith tabpanel:- Items not appearing if close and open the tab again



nikhilkrishnan
24 May 2009, 11:00 AM
I have created a tabpnel in which tabs are created by clicking on a tree node. The tab is appearing correctly along with its content. But if i close and the tab and open it again , the content is not appearing properly. The item of the tab is a window with some textfields and grid. if i open the tab again only window is appearing and not the texfields and grid. I'm using Ext JS 3.0 RC1.1.


treePanel.on('click', function(n){
switch(n.id){
case "apartement":apartement();break;
case "flat":flat();break;
case "service":service();break;


}

function apartement(){
centerTabPanel.add(grid);
centerTabPanel.doLayout();
centerTabPanel.setActiveTab(grid);
}
function flat(){
var uiViewContainer =centerTabPanel.add({
title: 'Apartement Management',
iconCls: 'tabs',
id:'apartement',
html: '<div style=\'height:350\' id=\'viewContainer\'>Apartement Management</div>',
closable:true,
autoScroll:true,
items:[winPanel.add(win);
centerTabPanel.doLayout();
centerTabPanel.setActiveTab(win);
}
function service(){
var uiViewContainer =centerTabPanel.add({
title: 'Service Management',
iconCls: 'tabs',
id:'service',
html: '<div style=\'height:350\' id=\'viewContainer\'>Service Management</div>',
closable:true,
autoScroll:true});
centerTabPanel.doLayout();
centerTabPanel.setActiveTab(uiViewContainer);
}

Animal
24 May 2009, 11:06 AM
autoDestroy?

It's a config of Container!

nikhilkrishnan
24 May 2009, 11:17 AM
autoDestroy?

It's a config of Container!

Do you mean like this

function apartment(){
var uiViewContainer =centerTabPanel.add({
title: 'Apartment Management',
iconCls: 'tabs',
id:'apartement',
html: '<div style=\'height:350\' id=\'viewContainer\'>Apartment Management</div>',
closable:true,
autoScroll:true,
autoDestroy:true,
items:[grid]


}).show();

If so, i already tried ...........

24 May 2009, 8:06 PM
when you close the tab, you 'detroy' the item. your problem might be that you need instantiate a new instance of what ever tab was closed.

nikhilkrishnan
26 May 2009, 1:34 AM
when you close the tab, you 'detroy' the item. your problem might be that you need instantiate a new instance of what ever tab was closed.


I tried adding 'destroy()'[for the item of the tabpanel] in the close event of the tabpanel, but still i'm getting the same result

Animal
26 May 2009, 2:07 AM
Did yuo actually read the API docs that I suggested you read?

nikhilkrishnan
26 May 2009, 2:40 AM
Did yuo actually read the API docs that I suggested you read?


I'm really new to programming and extjs, I'm still learning. May I know how can i solve this issue?

Animal
26 May 2009, 3:31 AM
Did you read the API docs that I suggested you read?