ExtJs4.0 login instance

Source: Internet
Author: User

[Javascript]
// JavaScript Document
// Load the prompt box
Ext. QuickTips. init ();
// Create a namespace
Ext. namespace ('ext. ExtJs. framework ');
// Main Application
Ext. ExtJs. Frame. app = function (){}
// Instantiate the program
Ext. extend (Ext. ExtJs. Frame. app, Ext. util. Observable ,{
// Program Header
AppTop: new Ext. Panel ({
Id: 'apptopid ', height: 35, frame: true, bodyStyle: 'padding-top: 4px', html: '}),
// Login form
AppMain: new Ext. form. FormPanel ({
Id: 'appmainid', defaultType: 'textfield ', labelAlign: 'right', labelWidth: 60, bodyStyle: 'text-align: center;', frame: true,
Defaults: {allowBlank: false },
Items: [{name: 'name', fieldLabel: 'logon account', blankText: 'account cannot be blank ', emptyText: 'required', anchor: '123 ', bodyStyle: 'margin-right: 10px ;'},
{Name: 'psd ', inputType: 'Password', fieldLabel: 'login password', blankText: 'password cannot be blank', maxLength: 10, anchor: '123'}]
}),
// Login window
AppWin: new Ext. Window ({width: 250, height: 150, closable: false, collapsible: false, resizable: false,
Ults: {border: false}, buttonAlign: 'center', buttons: [{text: 'about ', id: 'about'}, {text: 'login', id: 'login'}], layout: 'column ',
Items: [{columnWidth: 1, items: Ext. getCmp ("AppTopId") },{ columnWidth: 1, items: Ext. getCmp ("AppMainId")}]
}),
// Initialization
AppInit: function () {this. AppWin. show ();}
});
// Program entry
Ext. onReady (function (){
AppFrame = new Ext. ExtJs. Frame. app ();
AppFrame. AppInit ();
// Logon button event
Ext. get ('login '). on ('click', function () {Ext. msg. alert ('message', 'logon information... ');});
// About Button events
Ext. get ('about '). on ('click', function () {Ext. msg. alert ('message', 'about login loading .... ');});
});

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.