2016-04-04 1 views
1

hinzufügen Ich bin neu zu extjs 4.2.Versuche, eine POC für mein Projekt zu tun.nicht in der Lage, Elemente zu tab.panel in extjs

Just stuck at a point where am trying to add few more items to the tabs. 
Please find the code below. 
In tab1 I want add a textfield. 
But its not allowing and throwing a syntax error. 


####### 
    Ext.onReady(function() { 
    var textName={xtype:"textfield",fieldLabel:"username",margin:"10 10"}; 
    var tabObj=Ext.create("Ext.tab.Panel",{ 
    title: "Registration Form", 
    margin:"10 10 10 40", 
    plain:"false", 
    tabPosition:"bottom", 
    items : [ 
     { 
     title:"home", 
     html:"This is from Home Tab", 
     // xtype:"textfield",fieldLabel:"username",margin:"10 10"} 
     //textName 
     }, 
     { 
     title:"services" 
     }, 
     { 
     title:"stock" 
     } 
    ], 
    renderTo:Ext.getBody() 
    }); 
    }); 
####### 

Ich habe nicht viel Hilfe in der Dokumentation bekommen. In der Dokumentation werden die Beispiele nur angezeigt, um weitere Registerkarten mit dem HTML-Attribut hinzuzufügen, die keine weiteren Komponenten zu einer Registerkarte hinzufügen. Bitte helfen Sie mir hier.

Antwort

0

Vielleicht fehlen Sie items.

Zum Beispiel:

Ext.onReady(function() { 
     var textName = { 
      xtype: "textfield", 
      fieldLabel: "username", 
      margin: "10 10" 
     }; 
     var tabObj = Ext.create("Ext.tab.Panel", { 
      title: "Registration Form", 
      margin: "10 10 10 40", 
      plain: "false", 
      tabPosition: "bottom", 
      items: [{ 
       title: "home", 
       items: [ 
        textName 
       ] 
      }, { 
       title: "services" 
      }, { 
       title: "stock" 
      }], 
      renderTo: Ext.getBody() 
     }); 
    }); 

Ein Arbeitsbeispiel: https://fiddle.sencha.com/#fiddle/1854

+0

funktioniert es Ihnen danken ..... – satya