{items : [{ xtype : 'panel', layout : 'column', defaults : { layout : 'form' }, items : [ {columnWidth : .8, items :[ {xtype:"textfield", fieldLabel : '所在机构', name : 'user.organiseName', blankText : '请选择', emptyText : '机构名', readOnly : true, anchor : '90%', id:"_organiseDisplay", allowBlank: false }, {columnWidth : .2, items : [ {xtype:"textfield", fieldLabel : '姓名', maxLength :12, anchor : '90%', name : 'user.userName' }] }] }] }
ext中许多组件都有anchor这个属性,他一般与布局column一起使用,以文本组件为例:columnWidth的值乘以anchor的值,即为本组件所占的长度。
另外注意:anchor不可与设置长度的属性width同时出现,否则,width属性无效。