2、chrome、firefox正常运行
3、ie8 出错(360浏览器 同样)
错误: Object doesn't support this property or method :line 17 character 4
代码如下:(出错行在:loginForm = Ext.getCmp('loginForm'); )
Ext.define('XAYP.view.login.LoginWindow', {
extend : 'Ext.window.Window',
alias : 'widget.loginWindow',
title : '用户登录',
border : false,
layout : 'fit',
plain : true,
resizable : false,
buttonAlign : 'center',
requires : [ 'XAYP.view.login.LoginForm', 'XAYP.common.Definition', 'XAYP.proxy.Proxy' ],
initComponent : function() {
this.items = [ {
id : 'loginForm',
xtype : 'loginForm'
} ];
confirmButtonClick = function() {
loginForm = Ext.getCmp('loginForm');//出错指示行
if (loginForm.form.isValid()) {
loginForm.form.submit({
timeout : 60,
waitTitle : '登录中',
method : 'POST',
params : {
username : loginForm.form.username,
password : loginForm.form.password
},
waitMsg : '正在进行登陆验证,请稍后...',
url : XAYP.common.Definition.getRootUrl_Port() + '/userLogin/', // 提交到servlet地址
success : function(form, action) {
Ext.util.Cookies.set('username', action.result.username);
// Ext.util.Cookies.set('token',action.result.token);
if (action.result.success == true) {
window.location.href = "index.html";
} else if (action.result.success == false) {
Ext.Msg.alert('错误提示', action.result.msg);
}
},
failure : function(form, action) {
// Ext.Msg.alert('系统提示', action.result.text);
switch (action.failureType) {
case Ext.form.Action.CLIENT_INVALID:
Ext.Msg.alert('错误提示', '表单数据非法请核实后重新输入!');
break;
case Ext.form.Action.CONNECT_FAILURE:
Ext.Msg.alert('错误提示', '网络连接异常!');
break;
case Ext.form.Action.SERVER_INVALID:
Ext.Msg.alert('错误提示', "您的输入用户信息有误,请核实后重新输入!");
}
loginForm.form.reset();
}
});
}
};
this.buttons = [ {
text : '登录',
handler : confirmButtonClick
}, {
text : '重置',
handler : function() {
loginForm = Ext.getCmp('loginForm');
loginForm.form.reset();
}
} ];
this.listeners = {
keypress : {
element : 'body',
fn : function(e) {
if (e.getKey() == Ext.EventObject.ENTER) {
confirmButtonClick();
}
}
},
dblclick : {
element : 'body',
fn : function() {}
}
};
this.callParent(arguments);
},
logger : function(text) {
console.log("XAYP.view.tabs.UserListPanel: " + text);
},
flushView : function() {
this.doComponentLayout();
},
loadView : function() {
this.doComponentLayout();
}
});