背景

用ExtJS新写了一个功能,运行时控制台打印错误Cannot read property 'on' of undefined,出错代码位置是Ext.define.bindStoreListener。

分析

根据出错代码可以猜测出与store有关,但是依然没有头绪。对于新技术或未知问题,我只好祭出杀手锏“排除法”,先锁定问题所在。有计划的删除部分代码,再刷新页面尝试。然后,一遍遍重复直到不再报错。

最终,删除了一个combo控件后不再报错。这个控件中有个属性是store,应该是ExtJS在加载此处时出错。于是得出问题所在:页面控件中引用了store,但是Controller的stores属性没有加载。

解决方案

在Controller层添加要用的store。

 Ext.define('XXX', {
extend : 'Ext.app.Controller',
...
stores : [ '在此添加store']
...

ExtJS错误解决 Cannot read property 'on' of undefined的更多相关文章

  1. vue错误提示 Cannot read property 'beforeRouteEnter' of undefined,刷新后跳到首页

    vue错误提示 Cannot read property 'beforeRouteEnter' of undefined,刷新后跳到首页 因为vue-router版本太高了,我vue用的是2.3.4, ...

  2. NodeJS - Express 4.0错误:Cannot read property 'Store' of undefined

    按着<NodeJS开发指南>里的第五章建立microblog的例子操作,使用node.js 的express框架配置将session存储到mongodb时出错:TypeError: Can ...

  3. 记录一次(xheditor-1.1.6-zh-cn.min.js)的错误:Cannot read property 'match' of undefined的问题解决

    由于使用了xheditor富文本框,且这个版本是2011年开发的系统,当时只有IE8,所以一切正常. 但是问题来了,今天使用IE11测试和谷歌浏览器测试,发现一直报这个错误: 且google了一下,没 ...

  4. 73.node.js开发错误——TypeError: Cannot set property 'XXX' of undefined

    转自:https://blog.csdn.net/fd214333890/article/details/53467429

  5. Vue.js搭建路由报错 router.map is not a function,Cannot read property ‘component’ of undefined

    错误: 解决办法: 2.0已经没有map了,使用npm install vue-router@0.7.13 命令兼容1.0版本vue 但是安装完之后会出现一个错误: Cannot read prope ...

  6. [转载][jQuery] Cannot read property ‘msie’ of undefined错误的解决方法

    参考 [jQuery] Cannot read property ‘msie’ of undefined错误的解决方法 ---------------------------------------- ...

  7. [jQuery1.9]Cannot read property ‘msie’ of undefined错误的解决方法

    原文:[jQuery1.9]Cannot read property 'msie' of undefined错误的解决方法 $.browser在jQuery1.9里被删除了,所以项目的js代码里用到$ ...

  8. [jQuery] Cannot read property ‘msie’ of undefined错误的解决方法 --转

    初用Yii的srbac模块.出现 Cannot read property ‘msie’ of undefined 错误.上网查询,找到如下的文章.使用文末的打补丁的方法,成功搞定.感谢. ===== ...

  9. [jQuery] Cannot read property ‘msie’ of undefined错误的解决方法

    最近把一个项目的jQuery升级到最新版,发现有些页面报错Cannot read property ‘msie’ of undefined.上jQuery网站上搜了一下,原因是$.browser这个a ...

随机推荐

  1. Angular基础---->AngularJS的使用(一)

    AngularJS主要用于构建单页面的Web应用.它通过增加开发人员和常见Web应用开发任务之间的抽象级别,使构建交互式的现代Web应用变得更加简单.今天,我们就开始Angular环境的搭建和第一个实 ...

  2. diamond types are not supported at this language level

    在intellij导入git项目之后出现 diamond types are not supported at this language level错误 或者String等报错 File->P ...

  3. C# 验证码生成

    后台: //生成验证码 public void CreateImage() { //获取4位验证码,并转成小写. ).ToLower(); //验证码赋值Cookie HttpCookie myCoo ...

  4. treeview(树加载)

    数据库结构 id:int类型,主键,自增列:     Name:char类型:     paraid:int类型 窗台拖入控件treeview. 1.版本1 using System; using S ...

  5. Lodash 常用API中文参考

    lodash和underscore都是现在非常流行的两个javascript库,提供了一套函数式编程的实用功能. 而lodash本身最初也是underscore的一个fork,因为和其他(Unders ...

  6. 您好,前端使用https,后端使用https是会有冲突的情况,所以默认后端都是http 负载均衡即可管理证书,不需要在后端ECS上绑定证书。

    您前端使用https,那么前端就是加密的,后端使用https就是会访问出现问题的,目前阿里云负载均衡默认的配置前端使用https,后端默认就是http,也是无法更改的. 前端使用https,目前只有一 ...

  7. ping 10.13.5.233

    3. 环境 URL选择器 tableView ping 10.13.5.233

  8. C++ Design Pattern: What is a Design Pattern?

    Q: What is a Design Pattern? A: Design Patterns represent solutions to problems what arise when deve ...

  9. PID参数调整的口诀

    PID参数调整的口诀:参数整定找最佳,从小到大顺序查先是比例后积分,最后再把微分加曲线振荡很频繁,比例度盘要放大曲线漂浮绕大湾,比例度盘往小扳曲线偏离回复慢,积分时间往下降曲线波动周期长,积分时间再加 ...

  10. [py]数据描述符优先级

    实例查找属性的顺序: 类属性 > 数据描述符 > 实例属性 > 非数据描述符 > __getattr__ 类属性>数据描述符>实例属性 class Str: def ...