2013년 10월 16일 수요일

Displaying a simple form in a window

1. Start by creating a simple form with two fields and a button.
var form = Ext.create('Ext.form.Panel', {
bodyPadding: 10,
border: false,
defaultType: 'textfield',
items: [{
fieldLabel: 'Username',
name: 'username',
allowBlank: false
}, {
fieldLabel: 'Password',
name: 'password',
inputType: 'password',
allowBlank: false
}],
buttons: [{
text: 'Login',
formBind: true,
disabled: true,
handler: function(){
alert('Login Button Pressed');
}
}]

});
2. Create an Ext.window.Window with the form in its items collection and display it
to the user using the show method:

Ext.create('Ext.window.Window', {
title: 'Login Window',
height: 140,
width: 300,
layout: 'fit',
items: [form]
}).show();

댓글 없음:

댓글 쓰기