2014-10-01 82 views
0

我想在我的应用程序中生成一个FormPanel,由一个字段和两个按钮组成。 问题是,显示文本字段时,按钮不显示在视图上!ExtJs FormPanel按钮没有显示

这是Login.js观点:

Ext.define('appTrial.view.Login',{ 
extend: 'Ext.form.Panel', 
xtype: 'Login', 
alias: 'widget.Login', 

config : { 
    id : 'LoginId', 

    title : 'Welcome', 
    resizable : false, 
    collapsible : true, 
    bodyPadding : '5', 
    buttonAlign : 'center', 
    border : false, 
    trackResetOnLoad : true, 

    items : [{ 
     docked: 'top', 
     xtype: 'titlebar', 
     title: 'Welcome to My New App!!!' 
     }, 
     { 
     xtype: 'container', 
     name: 'mainContainer', 
     layout: { 
      type: 'vbox', 
      align: 'center', 
      pack: 'center' 
     }, 
     //width : '100%', 
      items : [{ 
       layout: { 
        pack: 'center' 
       }, 
       html :'Associa attivita', 
       margin: '80 0 0 0' 
      },{ 
       xtype: 'fieldset', 
       items: [{ 
        xtype: 'textfield', 
        name: 'codAttivita' 
       }] 
      }], 
      buttons :[{ 
       text : 'Associa', 
       itemId : 'btnAssocia', 
       formBind : true, 
       ui: 'confirm' 
      },{ 
       text : 'Reset', 
       itemId : 'btnReset', 
       formBind : true, 
       ui: 'decline' 
      }] 
    }] 
} 
}); 

没有人有任何想法? 在此先感谢

回答

0

容器没有按钮配置。您必须将按钮配置定义到formpanel对象中。

+0

我试图把按钮放在同一级别的项目,在配置属性,但它仍然无法使用 – Ago 2014-10-01 12:52:16