用Ext编写的用户登陆
来源:互联网 发布:鲁迪盖伊nba数据 编辑:程序博客网 时间:2024/06/09 14:33
LoginWindow.ui.js
LoginWindowUi = Ext.extend(Ext.Window, {
title: '用户登陆',
width: 300,
height: 137,
layout: 'fit',
resizable: false,
closable: false,
modal: true,
iconCls: 'userLoginWindowCls',
initComponent: function() {
this.items = [
{
xtype: 'form',
width: 287,
height: 73,
frame: true,
labelWidth: 50,
monitorValid: true,
id: 'userLoginForm',
items: [
{
xtype: 'textfield',
fieldLabel: '用户名',
anchor: '100%',
allowBlank: false,
blankText: '用户名不能为空',
name: 'user.userName'
},
{
xtype: 'textfield',
fieldLabel: '密 码',
anchor: '100%',
inputType: 'password',
allowBlank: false,
blankText: '密码不能为空',
name: 'user.userPwd'
}
]
}
];
this.fbar = {
xtype: 'toolbar',
buttonAlign: 'center',
items: [
{
xtype: 'button',
text: '登陆',
id: 'loginButton'
},
{
xtype: 'button',
text: '重置',
id: 'resetButton'
}
]
};
LoginWindowUi.superclass.initComponent.call(this);
}
});
LoginWindow.js
function login(){
Ext.getCmp('userLoginForm').form.submit({
url:basePath+'/public/userLogin.science',
waitMsg:'正在登录,请稍候!',
waitTitle:'提示',
success:function(form,action){
window.location.href=basePath+'/public/userLoginSuccess.science';
},
failure:function(form,action){
switch (action.failureType) {
case Ext.form.Action.CONNECT_FAILURE:
Ext.MessageBox.alert('错误', '通讯失败');
break;
case Ext.form.Action.SERVER_INVALID:
Ext.MessageBox.alert('错误', action.result.msg);
}
}
});
}
LoginWindow = Ext.extend(LoginWindowUi, {
keys:{
key:Ext.EventObject.ENTER,
shift:false,
ctrl:false,
alt:false,
fn:function(){//按钮响应函数
login();
}
},
initComponent: function() {
LoginWindow.superclass.initComponent.call(this);
Ext.getCmp('loginButton').addListener('click',function(){
login();
});
Ext.getCmp('resetButton').addListener('click',function(){
Ext.getCmp('userLoginForm').form.reset();
});
Ext.getCmp('userLoginForm').addListener('clientvalidation',function(form,isValid){
Ext.getCmp('loginButton').setDisabled(!isValid);
});
}
});
Ext.onReady(function(){
Ext.QuickTips.init();
var loginWindow = new LoginWindow({
renderTo: Ext.getBody()
});
loginWindow.show();
});
- 用Ext编写的用户登陆
- 用户登陆模块的编写
- struts框架编写的用户登陆代码
- 用Ext做的登陆窗口的例子
- android登陆的编写
- 写一个登陆用的用户控件。
- 用户登陆的退出
- Shell命令编写——查看当前登陆用户的登录时间ac,last
- 用户登陆后怎样防止用户用浏览器的后退按钮退出登陆后的页面 ?
- 编写你自己的单点登陆
- easyui 编写的登陆框
- 用swing组件来编写的QQ登陆程序
- ssh的用户登陆限制
- 实现用户登陆的Servlet
- 简单的用户登陆判断
- Catalyst 的用户鉴定登陆
- WebWork实现用户的登陆
- 列举当前登陆的用户
- 如何集成Windows login, forms集成验证?
- Dev Guide_01_AIDL/IPC机制
- 基于V4L2的视频驱动开发
- ZTOOL
- Sytem.IO.IOException:文件“XXX”正由另一进程使用,因此该进程无法访问该文件
- 用Ext编写的用户登陆
- 浅谈Windows XP系统漏洞的封堵
- (转)Oracle数据库优化方法总结
- 启用或禁用 UPnP 框架
- 2010/12/08早晨的杯具
- 我的电话
- 程序开发经验总结
- JVM内存管理:深入Java内存区域与OOM
- 最近得知了与人相处的道理