xiayh04 2013-03-27 20:51 采纳率: 0%
浏览 266
已采纳

extjs4.1 ie8 出错

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();
    }
});
  • 写回答

1条回答

  • FangXingXing007 2013-03-28 09:05
    关注

    loginForm = Ext.getCmp('loginForm');
    把loginForm变量用var 声明下,改成
    var loginForm = Ext.getCmp('loginForm');
    注意多用google、baidu搜一下

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型