1. #1
    Ext User
    Join Date
    Jun 2009
    Posts
    28
    Vote Rating
    0
    joshuaxu is on a distinguished road

      0  

    Question form field lost in tabpanel

    form field lost in tabpanel


    i have a problem: code is blow:
    Code:
     
    var form1 = new Ext.FormPanel({
            frame:true,
            title: 'Simple Form1',
            items: [{
        xtype: 'textfield',
                    fieldLabel: 'First Name',
                    name: 'first'
                }
            ]
        });
        var form2 = new Ext.FormPanel({
            frame:true,
            title: 'Simple Form2',
            layout:'table',
            items : [{
                colspan: 1,
                layout: 'form',
                items : [{
                    xtype: 'textfield',
                    fieldLabel: 'Second Name',
                    name : 'Second'
                }]
            }]
        });
        var tb=new Ext.TabPanel({
            height:300,
            activeTab:0,
            items:[form1,form2]
        });
        tb.render(document.body);
    then the textfield in form2 is cannot be seen. if i change "activeTab:0" to "activeTab:1", the textfield "Second" in form2 can be seen, but the textfield "first" is disappeared.
    how can i get the two form all be seen normally in tabpanel when using table layout.

  2. #2
    Sencha User
    Join Date
    Jan 2008
    Location
    Toronto, Canada
    Posts
    481
    Vote Rating
    4
    elishnevsky is on a distinguished road

      0  

    Default


    Can you please wrap your code in CODE tag? It's hard to read.
    Look here for help: http://extjs.com/forum/misc.php?do=bbcode

  3. #3
    Sencha - Services Team
    Join Date
    Mar 2007
    Location
    Foristell, MO
    Posts
    1,109
    Vote Rating
    3
    jratcliff is on a distinguished road

      0  

    Default


    Quote Originally Posted by joshuaxu View Post
    i have a problem: code is blow:
    Code:
     
       var form1 = new Ext.FormPanel({
            frame:true,
            title: 'Simple Form1',
            items: [{
        xtype: 'textfield',
                    fieldLabel: 'First Name',
                    name: 'first'
                }
            ]
        });
        var form2 = new Ext.FormPanel({
            frame:true,
            title: 'Simple Form2',
            layout:'table',
            items : [{
                colspan: 1,
                layout: 'form',
                items : [{
                    xtype: 'textfield',
                    fieldLabel: 'Second Name',
                    name : 'Second'
                }]
            }]
        });
        var tb=new Ext.TabPanel({
            height:300,
            activeTab:0,
            items:[form1,form2]
        });
        tb.render(document.body);
    then the textfield in form2 is cannot be seen. if i change "activeTab:0" to "activeTab:1", the textfield "Second" in form2 can be seen, but the textfield "first" is disappeared.
    how can i get the two form all be seen normally in tabpanel when using table layout.
    Seems to work perfect for me. When tab 1 is active, then only the first name is show and when tab 2 is active, only the second name is shown. What exactly are you expecting to see? Are you wanting both the first and second names to both show up at the SAME time? If so, why do you have each on a separate tab?

  4. #4
    Ext User
    Join Date
    Jun 2009
    Posts
    28
    Vote Rating
    0
    joshuaxu is on a distinguished road

      0  

    Default


    can you work perfect?
    the "cannot be seen" means: after running, the textfield in active tab is there, when you click the another tab which not acitved at the code, the textfield in this tab cannot be seen.
    please, directly copy my code to your page and run

  5. #5
    Ext User
    Join Date
    Jun 2009
    Posts
    28
    Vote Rating
    0
    joshuaxu is on a distinguished road

      0  

    Default


    please help me. this question confused me.

  6. #6
    Ext User
    Join Date
    Jun 2009
    Posts
    28
    Vote Rating
    0
    joshuaxu is on a distinguished road

      0  

    Default


    i found add this one of these two attribute in Tabpanel can solve then problem.

    layoutOnTabChange:true
    or
    deferredRender:false

    thanks all,

Thread Participants: 2