Extjs4.0 登陆界面

效果图:

Ext.onReady(function(){
var winLogin = Ext.create("Ext.window.Window",{
width : 400 ,
height : 270 ,
modal : true , // 窗口弹出,其他地方不可操作
title : ' 登陆 ' ,
collapsible : true ,  // 收缩按钮
closable : false , // 是否显示关闭窗口按钮
iconCls : 'key',// cog , database_gear
resizable : false , // 窗体是否可以拉伸
constrain:true,
items : [{
xtype:'panel',
width:'100%',
height:100,
padding:'1px',
html:"<img src='css/icons/1_log.png' height='100%' width='100%'/>"
},{
xtype:'form',
width:'100%',
id:'myform',
height:130,
//frame: true,
padding:'1px',
buttonAlign : 'center',
items:[{
xtype:'textfield',
id:'username',
name:'username',
fieldCls:'login_account',
fieldLabel:'账&nbsp;&nbsp;号&nbsp;&nbsp;',
width:300,
margin:'10,10,10,10',
labelAlign : 'right'

},{
xtype:"textfield",
id:'password',
name:'password',
fieldCls:'login_password',
width:300,
fieldLabel:'密&nbsp;&nbsp;码&nbsp;&nbsp;',
margin:'10,10,10,10',
labelAlign : 'right',
inputType:'password'
},{
xtype:'panel',
width:'100%',
bodyStyle: 'border:0',
html:"<p align='right'>版权所有:银川赛瑞格计算机科技有限公司</p>"
}],
buttons : [{
text:'登陆',
layout:'fit',
type:'submit',
handler:function(){
var _username = Ext.getCmp('username').getValue();
var _password = Ext.getCmp('password').getValue();

if(_username==""){
Ext.Msg.alert("提示","用户名不能为空,请输入用户名");
} else if(_password==""){
Ext.Msg.alert("提示","密码不能为空,请输入用户名");
} else {
// 掩饰层 (遮罩效果)
var myMask = new Ext.LoadMask(Ext.getBody(), {msg:"正在登陆,请稍后..."});
myMask.show();

Ext.Ajax.request({
url:'login.action',
method:'POST',
success:function(response,opts){
var sf= Ext.JSON.decode(response.responseText);
if(sf.success){
myMask.hide();
Ext.Msg.alert("提示","登陆成功!!!");
window.location.href="toIndex.action";
} else {
myMask.hide();
Ext.Msg.alert("提示","登陆失败...");
}
},
failure:function(response,opts){
myMask.hide();
Ext.Msg.alert("提示","登陆失败");
},
params:{
username:_username,
password:_password
}
})
}
}
},{
text:'重置',
handler:function(){
Ext.getCmp('myform').form.reset();
}
}]
}],
renderTo:Ext.getBody()
});
winLogin.show();
})

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值