1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    30
    Vote Rating
    0
    luoyu is on a distinguished road

      0  

    Question Ext.tab.Panel add a panel

    Ext.tab.Panel add a panel


    hi,I am working a tabpanel.I have a problem with it.
    First,I create a window and show,In the window,it has a tabpanel,in the tabpanel,it has two panel those are panel1 and panel2.Panel1 can be closed but not destory.Panel2 can do not close.
    Now , i close the panel1 (or hide),so the tabpanel will show the panel2.Then i want to add panel1 to the tabpanel by the 'add-panel1' button agian,but the panel1 can not display normal,it display on the panel2 position.I don't known the reason.Besause , if i add a new panel to the tabpanel,the panel will display normal ,for example ,i add a panel by the 'normal-add' button.

    [CODE]
    Ext.onReady(function() {
    var win = Ext.create('Ext.window.Window',{
    title :'tabb test',
    width : 500,
    height : 500,
    modal : true,
    layout : 'fit',
    tbar : [{
    xtype : 'button',
    text : 'add-panel1',
    handler : function(btn){
    var win = btn.up('window');
    var tab = btn.up('window').down('tabpanel');
    var comp = Ext.getCmp('panel1');

    tab.add(comp);
    tab.setActiveTab(comp);
    //comp.show();
    }
    },{
    xtype : 'button',
    text : 'normal-add',
    handler : function(btn){
    var tab = btn.up('window').down('tabpanel');
    tab.add({
    xtype : 'panel',
    title : 'panel3',
    html : 'panel3'
    });
    }
    }],
    items : [{
    xtype : 'tabpanel',
    autoDestroy: false,
    items : [{
    id : 'panel1',
    xtype : 'panel',
    html : 'panel1',
    title : 'panel1',
    closable : true,
    closeAction : 'hide'
    },{
    xtype : 'panel',
    html : 'panel2',
    title : 'panel2'
    }]
    }]
    });
    win.show();
    });

    [CODE]

    thank you.

  2. #2
    Sencha User
    Join Date
    Jun 2011
    Posts
    55
    Vote Rating
    0
    Gabanjo is on a distinguished road

      0  

    Default


    If you want you tab to re-appear in the sample try

    tab.insert(0,comp)

    instead of

    tab.add(comp)

    in you button handler.

  3. #3
    Sencha User
    Join Date
    Mar 2010
    Posts
    30
    Vote Rating
    0
    luoyu is on a distinguished road

      0  

    Default


    Quote Originally Posted by Gabanjo View Post
    If you want you tab to re-appear in the sample try

    tab.insert(0,comp)

    instead of

    tab.add(comp)

    in you button handler.
    thank you,i tried it .But it didn't work normal still.
    thank you very much.

  4. #4
    Sencha User
    Join Date
    Jun 2011
    Posts
    55
    Vote Rating
    0
    Gabanjo is on a distinguished road

      0  

    Default


    What version are you using ?

    I just tested and that code I gave, the tab.insert(), only works in 4.1.0-beta-3.

  5. #5
    Sencha User
    Join Date
    Jun 2011
    Posts
    55
    Vote Rating
    0
    Gabanjo is on a distinguished road

      0  

    Default


    You may want to have look at the thread http://www.sencha.com/forum/showthread.php?186846-How-to-hide-tabs-in-tabpanel

    T
    he code I posted there works in 4.0.7

  6. #6
    Sencha User
    Join Date
    May 2010
    Location
    Kiev, Ukraine
    Posts
    134
    Vote Rating
    7
    khmurach is on a distinguished road

      0  

  7. #7
    Sencha User
    Join Date
    Mar 2010
    Posts
    30
    Vote Rating
    0
    luoyu is on a distinguished road

      0  

    Default


    Quote Originally Posted by Gabanjo View Post
    What version are you using ?

    I just tested and that code I gave, the tab.insert(), only works in 4.1.0-beta-3.
    yes.before ,i worked in 4.0.As you say,I used the Extjs 4.1 version to work,i found it worked well.Thank you very much.

  8. #8
    Sencha User
    Join Date
    Mar 2010
    Posts
    30
    Vote Rating
    0
    luoyu is on a distinguished road

      0  

    Default


    Quote Originally Posted by khmurach View Post
    thank you for your help.I has resolved the problem.But i update my extjs version.I use the extjs 4.1 rc1 .Maybe it was a bug before.
    thank you very much.

  9. #9
    Sencha User
    Join Date
    Mar 2010
    Posts
    30
    Vote Rating
    0
    luoyu is on a distinguished road

      0  

    Default


    Quote Originally Posted by Gabanjo View Post
    You may want to have look at the thread http://www.sencha.com/forum/showthread.php?186846-How-to-hide-tabs-in-tabpanel

    T
    he code I posted there works in 4.0.7
    thank you.i know these.But i want to say why not to use the hideAction:"hide" config.right?

  10. #10
    Sencha User
    Join Date
    Jun 2011
    Posts
    55
    Vote Rating
    0
    Gabanjo is on a distinguished road

      0  

    Default


    yes, you're right, using hideAction seems to be the way to go.

    Anyway, glad to hear you got it working.

Thread Participants: 2

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi