如何在sencha-touch中定义内场

时间:2012-04-13 04:23:43

标签: sencha-touch sencha-touch-2

items: [
         {
          xtype: 'textareafield',
           label: 'references',
           items: [{
                    xtype:'textareafield',
                      }
                 ]
                   }]

我想在textarea中创建一个textarea字段,但它只显示一个textareafield而不显示内部textareafield。

1 个答案:

答案 0 :(得分:1)

items配置在此无效,因为Ext.field无法使用,请尝试使用component配置,如下所示:

{
    xtype: 'textfield',
    component: {
      xtype: 'container', 
      layout: 'vbox', 
      items: [
      {
        xtype: 'textareainput', 
        flex: 3,
      }, 
      {
        xtype: 'textareafield',
        flex: 1, 
      }
      ]},
},

P / S:Behine the scene,Sencha Touch 2默认将component配置设置为{xtype: "textareainput"},因此使用此方法,您可以插入任何所需内容,例如按钮等。

相关问题