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