extjs4.2 控制form表单中field等组件的宽度。
首先,确保form的layout是‘anchor’的。
然后,在代码中配置anchor属性,如下图:
initComponent: function () {
this.items = [{
xtype: ‘textfield‘,
padding: ‘10 0 0 5‘,
anchor: ‘30%‘,
fieldLabel: ‘申请书编号‘,
name: ‘appNum‘
},{
xtype: ‘textareafield‘,
padding: ‘10 0 0 0‘,
anchor: ‘100%‘,
grow: true,
name: ‘legCharger‘,
height: 150
}];
this.callParent();
}效果如下图:
本文出自 “技术人生” 博客,请务必保留此出处http://wangyuelucky.blog.51cto.com/1011508/1427265
extjs4 textfield width,布布扣,bubuko.com
原文:http://wangyuelucky.blog.51cto.com/1011508/1427265