1 {items : [{ 2 xtype : 'panel', 3 layout : 'column', 4 defaults : { 5 layout : 'form' 6 }, 7 items : [ 8 {columnWidth : .8, 9 items :[ 10 {xtype:"textfield", 11 fieldLabel : '所在机构', 12 name : 'user.organiseName', 13 blankText : '请选择', 14 emptyText : '机构名', 15 readOnly : true, 16 anchor : '90%', 17 id:"_organiseDisplay", 18 allowBlank: false 19 }, 20 {columnWidth : .2, 21 items : [ 22 {xtype:"textfield", 23 fieldLabel : '姓名', 24 maxLength :12, 25 anchor : '90%', 26 name : 'user.userName' }] 27 }] 28 }] 29 }
ext中许多组件都有anchor这个属性,他一般与布局column一起使用,以文本组件为例:columnWidth的值乘以anchor的值,即为本组件所占的长度。
另外注意:anchor不可与设置长度的属性width同时出现,否则,width属性无效。