有谁知道一个表单如何布局成两列啊
extjs吧
全部回复
仅看楼主
level 12
77jubao 楼主
2015年04月14日 15点04分 1
level 12
77jubao 楼主
我用的是extjs5.1版本的
2015年04月14日 15点04分 2
level 12
77jubao 楼主
Ext.define('app.view.system.UsersForm', {
extend : 'Ext.form.Panel',
alias : 'widget.UsersForm',
width:690,
height:500,
bodyStyle:'padding:5px',
defaultType:'textfield',
layout:'form',
baseCls:'x-plain',
defaults:{anchor:'95%'},
labelWidth:80,
buttonAlign:'center',
url: 'url: './users/saveOrUpdateUsers.do',',
// Fields will be arranged vertically, stretched to full width
layout: 'anchor',
defaults: {
msgTarget :'qtip',
labelWidth : 80
},
// The fields
defaultType: 'textfield',
items: [{
xtype:'panel',
layout:'column',
baseCls:'x-plain',
items:[{
layout:'form',
labelWidth:80,
baseCls:'x-plain',
columnWidth: .5,
items:[{
xtype:'textfield',
anchor:'95%',
fieldLabel:'<span style="color:green">客户姓名</span>',
name:'intentionName',
blankText:'请输入客户姓名!'
}]
},{
layout:'form',
baseCls:'x-plain',
labelWidth:80,
columnWidth: .5,
items:[{
xtype:'combo',
fieldLabel:'<span style="color:green">客户性别</span>',
name:'sex',
hiddenName:'sex',
typeAhead: true,
triggerAction: 'all',
lazyRender:true,
mode: 'local',
value:'先生',
anchor:'95%',
store: new Ext.data.ArrayStore({
id: 0,
fields:['id','name'],
data:[['0','先生'],['1','女士']],
autoLoad:true
}),
valueField: 'id',
displayField: 'name'
}]
}]
},{
fieldLabel: '登录账号',
name: 'logincode',
allowBlank: false
},{
fieldLabel: '登录密码',
name: 'password',
allowBlank: false
}],
// Reset and Submit buttons
buttons: [{
text: '重 置',
handler: function() {
this.up('form').getForm().reset();
}
}, {
text: '保 存',
formBind: true, //only enabled once the form is valid
disabled: true,
handler: function() {
var form = this.up('form').getForm();
if (form.isValid()) {
form.submit({
success: function(form, action) {
Ext.Msg.alert('Success', action.result.msg);
},
failure: function(form, action) {
Ext.Msg.alert('Failed', action.result.msg);
}
});
}
}
}]
});
2015年04月14日 15点04分 3
level 7
我是新手入门,过来学习
2015年04月15日 16点04分 4
我搭建了一个学习extjs的网站,欢迎访问:http://www.xxoojava.com/
2015年05月25日 16点05分
level 7
mark
2015年05月31日 08点05分 5
这样啊
2015年05月31日 10点05分
level 1
layout : 'column'
或者 layout : 'table' 自己去看api~
2015年06月11日 00点06分 6
level 8
layout:‘hbox’,
2015年07月17日 01点07分 7
level 6
楼主解决了吗
2016年09月05日 07点09分 8
没有啊
2016年09月10日 22点09分
level 1
两列的话直接在一个columnWidth=.8这种布局下多放几个items
2016年09月12日 06点09分 9
level 2
做成hbox,或者用margin决定位置。
2016年09月29日 00点09分 10
1