Results 1 to 3 of 3

Thread: Items in Items ... in TabPanel

  1. #1
    Sencha User
    Join Date
    May 2010
    Location
    Saarbrcken, Germany
    Posts
    33

    Question Items in Items ... in TabPanel

    Hi,

    I have a window with a TabPanel. In Tab1 there is a GridPanel, in Tab2 a FormPanel. The Grid works fine, but if i add ,items: [] to the FormPanel i get the follow error in firebug
    this.items.add is not a function
    this.items.add(c);
    even if the items are blank!

    heres the code:
    PHP Code:
    Ext.kv73.UserPanel Ext.extend(Ext.form.FormPanel, {
        
    id'newUserForm'
        
    ,bodyBorderfalse
        
    ,titlecurrentUserName
        
    ,autoHeighttrue
        
    ,bodyStyle:'padding:10px;'
        
    ,params: {
            
    create'Anlegen'
        
    }
        ,
    items: [{
            
    layout'column'
            
    ,borderfalse
            
    ,items: [{
                
    layout'form'
                
    ,columnWidth.7
                
    ,borderfalse
                
    ,items: [{
                    
    xtype'textfield'
                    
    ,fieldLabel'Benutzername'
                    
    ,allowBlankfalse
                    
    ,valuecurrentUserName
                    
    ,disabledtrue
                    
    ,name'userName'
                    
    ,anchor'100%'
                
    },{
                    
    xtype'textfield'
                    
    ,fieldLabel'Firma'
                    
    ,allowBlankfalse
                    
    ,name'firm'
                    
    ,anchor'100%'
                
    },{
                    
    xtype'textfield'
                    
    ,fieldLabel'Anrede'
                    
    ,allowBlankfalse
                    
    ,name'title'
                    
    ,anchor'100%'
                
    },{
                    
    xtype'textfield'
                    
    ,fieldLabel'Vorname'
                    
    ,allowBlankfalse
                    
    ,name'firstName'
                    
    ,anchor'100%'
                
    },{
                    
    xtype'textfield'
                    
    ,fieldLabel'Name'
                    
    ,allowBlankfalse
                    
    ,name'lastName'
                    
    ,anchor'100%'
                
    },{
                    
    xtype'textfield'
                    
    ,fieldLabel'Durchwahl'
                    
    ,allowBlankfalse
                    
    ,name'phone'
                    
    ,anchor'100%'
                
    },{
                    
    xtype'textfield'
                    
    ,fieldLabel'ZimmerNr'
                    
    ,allowBlankfalse
                    
    ,name'roomNr'
                    
    ,anchor'100%'
                
    },{
                    
    xtype'textfield'
                    
    ,fieldLabel'Info'
                    
    ,allowBlanktrue
                    
    ,name'info'
                    
    ,anchor'100%'
                
    }
                
    //,picBox
                
    ]
            }]
            ,
    buttons:[{
                
    text'Speichern'
                
    ,formBindtrue
                
    ,iconCls'icon-add'
                
    ,handler : function() {
                    
    this.createNewUser()
                }
                ,
    scopethis
            
    }]
        }]
        ,
    listeners: {
             
    //removed
        
    }
    });
    Ext.reg('userPanel'Ext.kv73.UserPanel); 
    previously I wrote the FormPanel in a variable and add it to the TabPanel. With exactly the same setting and it has worked

    If I completely remove items, it works again
    I overlook something? hope someone can help me

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    You should NOT put complex objects (params, items) in the Ext.kv73.UserPanel prototype.

    Instead, assign them in the initComponent method.

  3. #3
    Sencha User
    Join Date
    May 2010
    Location
    Saarbrcken, Germany
    Posts
    33

    Thumbs up

    you're just great thx

Similar Threads

  1. Panel with CompositeFields problem - this.items.items[0] is undefined
    By diablo in forum Ext 3.x: Help & Discussion
    Replies: 4
    Last Post: 14 Jun 2011, 9:23 PM
  2. Replies: 1
    Last Post: 2 Sep 2010, 2:25 PM
  3. Remove Some items from toolbar and add New Items Not Working
    By shajeerkt in forum Ext GWT: Discussion
    Replies: 3
    Last Post: 15 Feb 2010, 6:28 AM
  4. Extending Window with items gives this.items.add is not fcn
    By serff in forum Ext 2.x: Help & Discussion
    Replies: 17
    Last Post: 8 Feb 2010, 5:03 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •