Created
May 27, 2012 11:47
-
-
Save wfaler/2809641 to your computer and use it in GitHub Desktop.
helloExtJS.coffee
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tpl = new Ext.Template ['Hello {firstName} {lastName}!', | |
' Nice to meet you!'] | |
formPanel = new Ext.form.FormPanel | |
itemId: "formPanel" | |
frame: true | |
layout: "anchor" | |
defaultType: "textfield" | |
defaults: | |
anchor: "-10" | |
labelWidth: 65 | |
items: | |
[{fieldLabel: "First Name", | |
name: "firstName"} | |
{fieldLabel: "Last Name", | |
name: "lastName"}] | |
buttons: | |
[{text: "Submit", | |
handler: -> | |
inputPanel = this.up '#formPanel' | |
vals = inputPanel.getValues() | |
greeting = tpl.apply vals | |
Ext.Msg.alert('Hello!',greeting) | |
}] | |
main = -> | |
new Ext.window.Window | |
height: 125 | |
width: 200 | |
closable: false | |
title: "Input needed." | |
border: false | |
layout: "fit" | |
items: formPanel | |
.show() | |
Ext.onReady main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment