0

剛開始看煎茶觸摸煎茶建築師 - 與表單

任何人都可以請解釋一下,你就可以用「FieldSet中,FormPanel中和容器」

例如,創建一個畫面:有標題的形式,文本框和提交按鈕?

登錄畫面...

Title: Login 
TextField: username 
PasswordField: password 
Button: submit 

1)將這個登錄畫面是在一個容器中,設置和/或一個FormPanel中字段?

2)沒有標題的表單怎麼辦?只是文本框,按鈕,或只是一個標題,數據列表屏幕?

回答

0

我想示例代碼將有助於你:

Ext.define('MyApp.view.LoginSiteContainer', { 
extend: 'Ext.form.Panel', 
alias: 'widget.loginsitecontainer', 

config: { 
    id: 'loginform', 
    url: 'som_url', 
    items: [    
     { 
      xtype: 'container', 
      layout: { 
       type: 'vbox' 
      }, 
      items: [ 
       { 
        xtype: 'fieldset', 
        instructions: 'Login using existing account. Password is case sensitive.', 
        title: 'Login details', 
        items: [ 
         { 
          xtype: 'textfield', 
          id: 'login', 
          itemId: 'login', 
          label: 'Login' 
         }, 
         { 
          xtype: 'passwordfield', 
          id: 'password', 
          itemId: 'password', 
          label: 'Password' 
         } 
        ] 
       }, 
       { 
        xtype: 'panel', 
        layout: { 
         type: 'hbox' 
        }, 
        items: [ 
         { 
          xtype: 'button', 
          id: 'Login', 
          itemId: 'Login', 
          margin: '0.1em', 
          ui: 'confirm', 
          text: 'Login', 
          flex: 1 
         } 
        ] 
       } 
      ] 
     } 
    ], 
    listeners: [    
     { 
      fn: 'onLoginTap', 
      event: 'tap', 
      delegate: '#Login' 
     } 
    ] 
}, 


onLoginTap: function(button, e, options) { 
// login function here 
} 

});