2012-11-23 74 views
1

由於某種原因,我的表單面板未顯示。誰能幫忙?如果這是顯而易見的,我是一個新手,非常抱歉!它是建立與煎茶建築師,但我不明白爲什麼沒有字段的形式呈現?......Sencha觸摸表單面板未顯示

Ext.define('MyApp.view.Login', { 
    extend: 'Ext.Container', 

    config: { 
     layout: { 
      type: 'vbox' 
     }, 
     items: [ 
      { 
       xtype: 'titlebar', 
       docked: 'top', 
       title: 'My Title' 
      }, 
      { 
       xtype: 'toolbar', 
       docked: 'top', 
       items: [ 

        { 
         xtype: 'button', 
         text: 'Call' 
        }, 
        { 
         xtype: 'button', 
         text: 'Email' 
        }      
       ] 
      }, 
      { 
       xtype: 'container', 
       flex: 1, 
       border: 2, 
       items: [ 
        { 
         xtype: 'formpanel', 
         styleHtmlContent: true, 
         items: [ 
          { 
           xtype: 'fieldset', 
           title: 'MyFieldSet', 
           items: [ 
            { 
             xtype: 'textfield', 
             label: 'Field' 
            }, 
            { 
             xtype: 'textfield', 
             label: 'Field' 
            } 
           ] 
          } 
         ] 
        } 
       ] 
      } 
     ] 
    } 

}); 

回答

2

更改登錄鑑於layoutvboxfit。然後將包含您的表單面板的容器的layout也設置爲fit

檢查this link欲瞭解更多關於Sencha Touch佈局的信息。

+0

正確內的其他容器顯示FormPanel中(Ext.form.Panel)? –

+0

兩個容器;)我已經編輯了更清晰的答案。謝謝。 – weerd2

+0

它實際上只需要一個佈局:'適合'包含表格的容器 –

3

要使用煎茶觸摸2.3及以上版本,你需要添加scrollable: null財產

{ 
    xtype: 'formpanel', 
    scrollable: null,   
    items: [ 
     ... 
    ] 
} 

見討論here哪些「容器」