Code:
function showAddForm_Grid1(){
add_form = new Ext.FormPanel({
// title: 'Add BulletIn Users',
border: false,
modal: true,
frame: true,
padding: 20,
autoScroll: true,
monitorValid: true,
fieldDefaults: {
// labelAlign: 'top',
msgTarget: 'under',
labelWidth: 75
},
defaults: {
margins: '0 0 10 0',
anchor: '99%'
},
items: [{
xtype: 'fieldset',
title: 'User',
labelStyle: 'font-weight:bold;padding:0',
layout: 'column',
columnWidth : '1',
defaultType: 'textfield',
fieldDefaults: {
labelAlign: 'left'
},
items: [{
flex: 1,
id: 'user_name',
fieldLabel: '<font color="red"> * </font>Username',
name: 'User Name',
//enableKeyEvents: true,
allowBlank:false,
blankText:"This field is required",
msgTarget:"under",
width:240,
margins: '0 0 0 10',
vtype: 'alpha'
},{
flex:1,
id: 'password',
//xtype: 'password',
fieldLabel: '<font color="red"> * </font>Password',
inputType:'password',
name: 'Password',
allowBlank:false,
blankText:"This field is required",
msgTarget:"under",
width:240,
margins: '0 0 0 10'
//disabledDays: [0,1,2,3,4],
//value: last_name
}]
},{
xtype: 'fieldset',
labelStyle: 'font-weight:bold;padding:0',
layout: 'anchor',
title: 'Personal Details',
items: [{
xtype: 'container',
labelWidth : 90,
layout: 'column',
columnWidth : '1',
defaultType: 'textfield',
fieldDefaults: {
labelAlign: 'left'
},
items: [{
flex: 1,
fieldLabel: 'First Name',
name: 'first_name',
id: 'first_name',
allowBlank:false,
blankText:"This field is required",
msgTarget:"under",
width:240,
margins: '0 0 0 10',
vtype: 'alpha'
},{
flex:1,
fieldLabel: 'Last Name',
name: 'last_name',
id: 'last_name',
allowBlank:false,
blankText:"This field is required",
msgTarget:"under",
width:240,
margins: '0 0 0 10'
}]
},{
xtype: 'container',
layout: 'column',
columnWidth : '1',
labelWidth : 90,
defaultType: 'textfield',
items: [{
flex: 1,
xtype: 'textfield',
fieldLabel: 'Address 1',
name: 'address_1',
id: 'address_1',
allowBlank: false,
width:240,
margins: '0 0 0 10'
// msgTarget: 'under'
},{
flex: 1,
xtype: 'textfield',
fieldLabel: 'Address 2',
name: 'address_2',
id: 'address_2',
// allowBlank: false,
// msgTarget: 'under',
vtype: 'alpha',
width:240,
margins: '0 0 0 10'
}]
},{
xtype: 'container',
labelWidth : 90,
columnWidth : '1',
//labelStyle: 'font-weight:bold;padding:0',
layout: 'column',
defaultType: 'textfield',
items: [{
flex: 1,
xtype: 'textfield',
fieldLabel: 'city',
name: 'city',
id: 'city',
allowBlank:false,
blankText:"This field is required",
msgTarget:"under",
width:240,
margins: '0 0 0 10'
},{
flex: 1,
xtype: 'textfield',
fieldLabel: 'state',
name: 'state',
id: 'state',
allowBlank:false,
blankText:"This field is required",
msgTarget:"under",
width:240,
margins: '0 0 0 10'
}]
},{
xtype: 'container',
layout: 'column',
columnWidth : '1',
defaultType: 'textfield',
labelWidth : 90,
items: [{
flex: 1,
xtype: 'textfield',
fieldLabel: 'Pin Number',
name: 'pin_number',
id: 'pin_number',
vtype: 'number',
allowBlank:false,
msgTarget:'under',
width:240,
margins: '0 0 0 10'
//margins: '0 0 0 10'
},{
flex: 1,
xtype: 'textfield',
fieldLabel: 'Fax ',
name: 'fax',
id: 'fax',
vtype: 'number',
allowBlank:false,
msgTarget:'under',
width:240,
margins: '0 0 0 10'
}]
},{
xtype: 'container',
layout: 'column',
columnWidth : '1',
labelWidth : 90,
defaultType: 'textfield',
fieldDefaults: {
labelAlign: 'left'
},
items: [{flex: 1,
xtype: 'textfield',
fieldLabel: 'Phn Number',
name: 'phone_number',
id: 'phone_number',
width:240,
//allowNegative:false,
allowBlank:false,
vtype: 'mobile',
msgTarget:'under',
margins: '0 0 0 10'
},{
flex: 1,
xtype: 'textfield',
fieldLabel: 'Mob Number',
name: 'mobile_number',
id: 'mobile_number',
allowBlank:false,
vtype: 'mobile',
msgTarget:'under',
width:240,
margins: '0 0 0 10'
}]},{
//flex: 1,
id: 'email',
xtype: 'textfield',
fieldLabel: 'Email Id',
name: 'email',
vtype:'email',
allowBlank:false,
msgTarget:'under',
width:240,
margins: '0 0 0 10'
},
role_id_grid
]
}]
});