Ext.onReady(login);
//登录页面
function login(){
//初始化quick实例
Ext.QuickTips.init();
var loginname=new Ext.form.TextField({
allowBlank:false,
fieldLabel:'用户名',
maxLength:12,
minLength:6,
align:'center',
msgTarget:'qtip',
name:'su.superlogin',
width:160,
maxLengthText:'用户名输入的太长!',
blankText:'用户名不能为空!',
labelStyle:'margin-top:25px',
style:{
marginTop:'25px'
}
});
var loginPwd=new Ext.form.TextField({
fieldLabel:'密 码',
allowBlank:false,
maxLength:20,
minLength:6,
align:'center',
msgTarget:'qtip',
name:'su.superpwd',
inputType:'password',//使文本框变成密码框
width:160,
labelStyle:'margin-top:25px',//设置文本字体的样式
//设置文本域的样式
style:{
marginTop:'25px'
},
blankText:'密码不能为空!'
});
var form=new Ext.form.FormPanel({
title:'管理员登录',
width:'auto',
height:200,
labelAlign:'right',
buttonAlign:'center',
items:[
loginname,
loginPwd
],
//也可以用listeners监听登录的情况
buttons:[{'text':'登 录',handler:function(){
//判断输入的信息是否合法
if(form.getForm().isValid()){
form.getForm().submit({
url:'super.do?method=checkLogin',method:'post',
params:'',
success:function(form,action){
Ext.Msg.alert("信息",action.result.msg,function(e){
if(e=='ok'){
win.close();
fun();//调用显示学生信息的窗体
}
});
},
failure:function(form,action){
Ext.Msg.alert("信息",action.result.msg);
}
});
}
}},{'text':'取 消',handler:function(){
form.getForm().reset();//重置按钮
}}]
//使用listeners监听登录的情况
/* buttons:[{'text':'登 录',listeners:
{
"click":function(){
//判断输入的信息是否合法
if(form.getForm().isValid()){
Ext.Ajax.request({
method:'post',
url:'super.do?method=checkLogin',
params:'',
callback:function(opions,success,response){
Ext.Msg.alert("提示",response.responseText,function(e){
if(e=='ok'){
win.close();
fun();//调用显示学生信息的窗体
}
});
}
});
}}
}}
,{'text':'取 消',handler:function(){
form.getForm().reset();//重置按钮
}}]*/
});
loginname.markInvalid();
loginPwd.markInvalid();
var win=new Ext.Window({
title:'学员信息管理',
autoHeight:true,
width:400,
resizable:false,
items:[form]
});
win.show();
}
//登录页面
function login(){
//初始化quick实例
Ext.QuickTips.init();
var loginname=new Ext.form.TextField({
allowBlank:false,
fieldLabel:'用户名',
maxLength:12,
minLength:6,
align:'center',
msgTarget:'qtip',
name:'su.superlogin',
width:160,
maxLengthText:'用户名输入的太长!',
blankText:'用户名不能为空!',
labelStyle:'margin-top:25px',
style:{
marginTop:'25px'
}
});
var loginPwd=new Ext.form.TextField({
fieldLabel:'密 码',
allowBlank:false,
maxLength:20,
minLength:6,
align:'center',
msgTarget:'qtip',
name:'su.superpwd',
inputType:'password',//使文本框变成密码框
width:160,
labelStyle:'margin-top:25px',//设置文本字体的样式
//设置文本域的样式
style:{
marginTop:'25px'
},
blankText:'密码不能为空!'
});
var form=new Ext.form.FormPanel({
title:'管理员登录',
width:'auto',
height:200,
labelAlign:'right',
buttonAlign:'center',
items:[
loginname,
loginPwd
],
//也可以用listeners监听登录的情况
buttons:[{'text':'登 录',handler:function(){
//判断输入的信息是否合法
if(form.getForm().isValid()){
form.getForm().submit({
url:'super.do?method=checkLogin',method:'post',
params:'',
success:function(form,action){
Ext.Msg.alert("信息",action.result.msg,function(e){
if(e=='ok'){
win.close();
fun();//调用显示学生信息的窗体
}
});
},
failure:function(form,action){
Ext.Msg.alert("信息",action.result.msg);
}
});
}
}},{'text':'取 消',handler:function(){
form.getForm().reset();//重置按钮
}}]
//使用listeners监听登录的情况
/* buttons:[{'text':'登 录',listeners:
{
"click":function(){
//判断输入的信息是否合法
if(form.getForm().isValid()){
Ext.Ajax.request({
method:'post',
url:'super.do?method=checkLogin',
params:'',
callback:function(opions,success,response){
Ext.Msg.alert("提示",response.responseText,function(e){
if(e=='ok'){
win.close();
fun();//调用显示学生信息的窗体
}
});
}
});
}}
}}
,{'text':'取 消',handler:function(){
form.getForm().reset();//重置按钮
}}]*/
});
loginname.markInvalid();
loginPwd.markInvalid();
var win=new Ext.Window({
title:'学员信息管理',
autoHeight:true,
width:400,
resizable:false,
items:[form]
});
win.show();
}