转自:http://blog.youkuaiyun.com/yu624774720hua/article/details/6556864
初级login.html
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
- <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" mce_href="resources/css/ext-all.css" />
- <title>注册</title>
- <mce:script type="text/javascript" src="../../adapter/ext/ext-base.js" mce_src="adapter/ext/ext-base.js"></mce:script>
- <mce:script type="text/javascript" src="../../ext-all.js" mce_src="ext-all.js"></mce:script>
- <mce:script type="text/javascript" src="../../build/locale/ext-lang-zh_CN.js" mce_src="build/locale/ext-lang-zh_CN.js"></mce:script>
- <mce:script type="text/javascript"><!--
- Ext.onReady(function(){
- new Ext.Window({
- title:"添加人员",
- width:500,
- height:350,
- plain:true,
- layout:"form",
- labelWidth:59,
- defaultType:"textfield",
- items:[{
- xtype:"panel",
- baseCls:"x-plain",
- style:"padding:5px",
- layout:"column",
- items:[{
- columnWidth:.5,
- layout:"form",
- labelWidth:55,
- defaultType:"textfield",
- defaults:{width:160},
- baseCls:"x-plain",
- items:[{
- fieldLabel:"姓名"
- },{
- fieldLabel:"年龄"
- },{
- fieldLabel:"出生日期"
- },{
- fieldLabel:"联系电话"
- },{
- fieldLabel:"手机号码"
- },{
- fieldLabel:"电子邮件"
- },{
- fieldLabel:"性别"
- }]
- },{
- columnWidth:.5,
- layout:"form",
- labelWidth:55,
- baseCls:"x-plain",
- items:{
- xtype:"textfield",
- fieldLabel:"个人照片",
- width:170,
- height:177,
- inputType:"image"
- }
- }]
- },{
- fieldLabel:"身份证号",
- width:400
- },{
- fieldLabel:"具体地址",
- width:400
- },{
- fieldLabel:"职位"
- }],
- showLock:false,
- listeners:{
- "show":function(_window){
- if(!_window["showLock"]){
- _window.findByType("textfield")[7].getEl().dom.src = "default_pic.gif" ;
- _window["showLock"] = true;
- }
- }
- },
- buttons:[{
- text:"确定",
- handler:function(){
- alert(this.ownerCt.buttons[1].text) ;
- }
- },{
- text:"取消"
- }]
- }).show() ;
- }) ;
- // --></mce:script>
- </head>
- <body>
- </body>
- </html>
高级login.html
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
- <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" mce_href="resources/css/ext-all.css" />
- <title>注册</title>
- <mce:script type="text/javascript" src="../../adapter/ext/ext-base.js" mce_src="adapter/ext/ext-base.js"></mce:script>
- <mce:script type="text/javascript" src="../../ext-all.js" mce_src="ext-all.js"></mce:script>
- <mce:script type="text/javascript" src="../../build/locale/ext-lang-zh_CN.js" mce_src="build/locale/ext-lang-zh_CN.js"></mce:script>
- <mce:script type="text/javascript"><!--
- Ext.onReady(function(){
- new Ext.Window({
- title:"添加人员",
- width:510,
- height:360,
- plain:true,
- layout:"form",
- labelWidth:59,
- defaultType:"textfield",
- defaults:{anchor:"95%"},
- items:[{
- xtype:"panel",
- baseCls:"x-plain",
- style:"padding:5px",
- layout:"column",
- items:[{
- columnWidth:.5,
- layout:"form",
- labelWidth:55,
- defaultType:"textfield",
- defaults:{width:160},
- baseCls:"x-plain",
- items:[{
- fieldLabel:"姓名"
- },{
- fieldLabel:"年龄",
- value:28,
- readOnly:true
- },{
- xtype:"datefield",
- format:"Y-m-d",
- value:"1981-10-18",
- readOnly:true,
- fieldLabel:"出生日期",
- listeners:{
- "blur":function(_df){
- var _age = _df.ownerCt.findByType("textfield")[1] ;
- _age.setValue(new Date().getFullYear() - _df.getValue().getFullYear() + 1) ;
- }
- }
- },{
- fieldLabel:"联系电话"
- },{
- fieldLabel:"手机号码"
- },{
- fieldLabel:"电子邮件"
- },{
- xtype:"combo",
- fieldLabel:"性别",
- mode :"local",
- displayField :"sex",
- readOnly:true,
- triggerAction : "all",
- value:"男",
- store:new Ext.data.SimpleStore({
- fields:["sex"],
- data:[["男"] , ["女"]]
- })
- }]
- },{
- columnWidth:.5,
- layout:"form",
- labelWidth:55,
- baseCls:"x-plain",
- items:{
- xtype:"textfield",
- fieldLabel:"个人照片",
- width:170,
- height:177,
- inputType:"image"
- }
- }]
- },{
- fieldLabel:"身份证号",
- width:400
- },{
- fieldLabel:"具体地址",
- width:400
- },{
- fieldLabel:"职位"
- }],
- showLock:false,
- listeners:{
- "show":function(_window){
- if(!_window["showLock"]){
- _window.findByType("textfield")[5].getEl().dom.src = "default_pic.gif" ;
- _window["showLock"] = true;
- }
- }
- },
- buttons:[{
- text:"确定",
- handler:function(){
- alert(this.ownerCt.buttons[1].text) ;
- }
- },{
- text:"取消"
- }]
- }).show() ;
- }) ;
- // --></mce:script>
- </head>
- <body>
- </body>
- </html>
login界面
twoTextFieldLoginWindow.html
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
- <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" mce_href="resources/css/ext-all.css" />
- <title>登陆窗体</title>
- <mce:script type="text/javascript" src="../../adapter/ext/ext-base.js" mce_src="adapter/ext/ext-base.js"></mce:script>
- <mce:script type="text/javascript" src="../../ext-all.js" mce_src="ext-all.js"></mce:script>
- <mce:script type="text/javascript" src="../../build/locale/ext-lang-zh_CN.js" mce_src="build/locale/ext-lang-zh_CN.js"></mce:script>
- <mce:script type="text/javascript"><!--
- Ext.onReady(function(){
- var _window = new Ext.Window({
- title:"测试窗体",
- layout:"form",
- width:300,
- plain:true,
- items:[{
- xtype:"textfield",
- fieldLabel:"姓名"
- },{
- xtype:"textfield",
- fieldLabel:"密码"
- }],
- buttons:[{
- text:"确定",
- handler:function(){
- var _coll = this.ownerCt.items ;
- var _temp = "" ;
- _temp += "姓名是:" + _coll.first().getValue() ;
- _temp += "密码是:" + _coll.itemAt(1).getValue() ;
- alert(_temp) ;
- }
- }]
- }) ;
- _window.show() ;
- }) ;
- // --></mce:script>
- </head>
- <body>
- </body>
- </html>