问题描述
- 如何在EXT文本框后面加一个按钮
-
在Ext.formPanel 中 如何在textfield后面加一个按钮(按钮要和文本框在一排)var EXT_ID = new Ext.form.TextField({ fieldLabel: '编号', name : 'EXT_ID', maxLength : 30, anchor : '40%' });
RWSD.form = new Ext.form.FormPanel({
region : 'north',
frame : true,
labelWidth : 120,
width : 'auto',
labelAlign : 'right',
buttonAlign : 'center',
height : 100,
items : [{
layout : 'column',
items : [{
columnWidth : 1,
layout : 'form',
labelWidth : 80,
items : [EXT_ID]
}]
}]
});
解决方案
var EXT_ID = new Ext.form.TextField({
fieldLabel: '编号',
name: 'EXT_ID',
maxLength: 30,
anchor: '40%'
});
var btn = new Ext.Button({text:'click me' });
RWSD.form = new Ext.form.FormPanel({
region: 'north',
frame: true,
labelWidth: 120,
width: 'auto',
labelAlign: 'right',
buttonAlign: 'center',
height: 100,renderTo:document.body,
items: [{
layout: 'column',
items: [{
columnWidth: .8,
layout: 'form',
labelWidth: 80,
items: [EXT_ID]
}, {
columnWidth: .2,
items: [btn]
}]
}]
});
时间: 2024-10-29 18:24:08