Ext.define('SchoolApp.view.student.StudentMaster', {
extend: 'Ext.form.Panel',
requires: ['SchoolApp.view.student.StudentViewModel'],
alias: 'widget.StudentMasterForm',
config: {},
viewModel: { type: 'StudentViewModel' },
bind: {
title: '{title} Information'
},
constructor: function (config) {
return this.callParent(arguments);
},
initComponent: function () {
Ext.apply(this, {
collapsible: true,
bodyPadding: '5',
buttonAlign: 'center',
border: false,
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
fieldLabel: 'Id',
xtype: 'textfield',
name: 'Id',
readOnly: true,
width: '35',
bind: {
value: '{theStudent.Id}'
}
},
{
xtype: 'textfield',
fieldLabel: 'First Name',
bind: {
value: '{theStudent.firstName}'
}
},
{
xtype: 'textfield',
fieldLabel: 'Last Name',
bind: {
value: '{theStudent.lastName}'
}
},
{
xtype: 'displayfield',
fieldLabel: 'Full Name',
bind: {
value: '{fullName}'
}
},
{
xtype: 'datefield',
fieldLabel: 'DoB',
name: 'birthDate',
bind: {
value: '{theStudent.birthDate}'
}
},
{
xtype: 'container',
layout: 'hbox',
items: [
{
xtype: 'fieldcontainer',
flex: 1,
layout: 'hbox',
items: [
{
xtype: 'fieldcontainer',
flex: 1,
layout: 'anchor',
items: [
{
xtype: 'textfield',
fieldLabel: 'Address1',
name: 'address1',
anchor: '95%',
bind: {
value: '{theStudent.address1}'
}
},
{
xtype: 'textfield',
fieldLabel: 'Address2',
name: 'address2',
anchor: '95%',
bind: {
value: '{theStudent.address2}'
}
}
]
},
{
xtype: 'fieldcontainer',
flex: 1,
layout: 'anchor',
items: [
{
xtype: 'textfield',
fieldLabel: 'City',
name: 'city',
anchor: '100%',
bind: {
value: '{theStudent.city}'
}
},
{
xtype: 'textfield',
fieldLabel: 'State',
name: 'state',
anchor: '100%',
bind: {
value: '{theStudent.state}'
}
}
]
}]
}]
}],
buttons: [
{ text: 'Save', itemID: 'btnSave' },
{ text: 'Reset' }
]
});
this.callParent(arguments);
}
});