Hello,
Was wondering if there is any better way to get the basic form back in the following example without having to use Ext.getCmp() on the button handler?
Code:
{
title: 'Login',
width: 400,
items: {
xtype: 'form',
id: 'login-form',
defaults: {
anchor: '95%',
allowBlank: false
},
items: [ {
xtype: 'textfield',
fieldLabel: 'Email',
vtype: 'email'
}, {
xtype: 'textfield',
fieldLabel: 'Password',
inputType: 'password'
}, {
xtype: 'checkbox',
boxLabel: 'Remember Me'
} ],
buttons: [ {
text: 'Login',
handler: function() {
if (Ext.getCmp('login-form').getForm().isValid()) {
alert('Valid');
}
}
} ]
}
}
Cheers,
Timothy