xpressly
2010-04-26 17:14 阅读 327

Ext中关于column布局的一个问题!

[code="java"]var rankAttrGroup = new Ext.form.FieldSet({
xtype:'fieldset',title: '业务属性',collapsible: true, autoHeight:true,

items:[
{layout:'column',border:false,
items: [
{columnWidth:.63,layout: 'form',border:true,
items: [{xtype:'textfield',fieldLabel:'属性A',name: 'email',anchor:'100%'},
{xtype:'textfield',fieldLabel:'属性B',name: 'email',anchor:'100%'},
{xtype:'textfield',fieldLabel:'属性C',name: 'email',anchor:'100%'},
{xtype:'textfield',fieldLabel:'属性D',name: 'email',anchor:'100%'},
{xtype:'textfield',fieldLabel:'属性E',name: 'email',anchor:'100%'}
]
},
{columnWidth:.37,layout: 'form',border:true,
items: [{xtype:'textfield',hideLabel:true,name: 'email',anchor:'100%'},
{xtype:'textfield',hideLabel:true,name: 'email',anchor:'100%'},
{xtype:'textfield',hideLabel:true,name: 'email',anchor:'100%'},
{xtype:'textfield',hideLabel:true,name: 'email',anchor:'100%'}, ]
}
]
}
]

});[/code]

上面的代码,我想把属性A占满第一行。就是类似colsapn=2这样的效果,要如何修改?谢谢!

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

2条回答 默认 最新

  • 已采纳
    works001 works001 2010-04-26 18:33

    var rankAttrGroup = new Ext.form.FieldSet({

    title: '业务属性',
    collapsible: true,
    autoHeight:true,

    items:[

    {layout:'form',border:false, //采用form布局 使得属性A占满整行(结合 anchor:'100%')
    items: [

    {xtype:'textfield',fieldLabel:'属性A',name: 'email',anchor:'100%'},

    {layout:'column',border:true,

    items: [

    {
    columnWidth:.63,layout: 'form',border:true,

    items:[
    {xtype:'textfield',fieldLabel:'属性C',name: 'email',anchor:'100%'},

    {xtype:'textfield',fieldLabel:'属性D',name: 'email',anchor:'100%'},

    {xtype:'textfield',fieldLabel:'属性E',name: 'email',anchor:'100%'}

    ]
    },

    {
    columnWidth:.37,layout: 'form',border:true,

    items: [
    {xtype:'textfield',hideLabel:true,name: 'email',anchor:'100%'},

    {xtype:'textfield',hideLabel:true,name: 'email',anchor:'100%'},

    {xtype:'textfield',hideLabel:true,name: 'email',anchor:'100%'}
    ]

    }
    ]
    }

    ]
    }
    ]

    }); //这样就能实现你要的了

    点赞 评论 复制链接分享
  • Rooock Rooock 2010-04-26 19:40

    可以参考下{%EXT_HOME%}/examples/form/check-radio.html

    点赞 评论 复制链接分享

相关推荐