背景

用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. ajax响应报文可以被浏览器缓存的必要条件

    1.发送请求时必须使用get方法. 2.服务器端设置响应报文的Expires为希望浏览器缓存的时间 如果这两个条件都不满足时,也就是说无法通过浏览器缓存来缓存文件时: 在js中设置一个localCac ...

  2. executeQuery、executeUpdate 和 execute

    Statement 接口提供了三种执行 SQL 语句的方法:executeQuery.executeUpdate 和 execute.使用哪一个方法由 SQL 语句所产生的内容决定. 1. Resul ...

  3. maven项目使用SOLR时报 previously initiated loading for a different type with name "javax/servlet/http/HttpServletRequest" 错的解决方法

    环境:Apache solr4.8,maven3,IntellijIDEA 想在项目中使用solr 在pom.xml文件中添加了solr的依赖 solr-core,solrj 和solr-dataim ...

  4. Egret P2 入门学习资料

    1 p2库下载: https://github.com/egret-labs/egret-game-library/tree/rc/4.1.0 2 p2 作者demo:https://github.c ...

  5. mysql动态sql 整理多个字段

    原始表: 整理后的表: 方案一(动态sql): BEGIN #Routine body goes here... DECLARE v1 ); DECLARE v2 ); #DECLARE v3 VAR ...

  6. ubuntu win7双系统设置开机启动顺序

    ctrl+alt+t打开命令终端 sudo chmod +w /boot/grub/grub.cfg (赋予该文件写权限) sudo gedit /boot/grub/grub.cfg 将set de ...

  7. Online handwriting recognition using multi convolution neural networks

    w可以考虑从计算机的“机械性.重复性”特征去设计“低效的”算法. https://www.codeproject.com/articles/523074/webcontrols/ Online han ...

  8. python为什么需要reload(sys)后设置编码

    python在安装时,默认的编码是ascii,当程序中出现非ascii编码时,python的处理常常会报这样的错UnicodeDecodeError: 'ascii' codec can't deco ...

  9. 关于mysql5.7的一些变化

    最近接了个项目,使用的数据库是5.7的,开始没太在意,但是在接手的过程中发送了些小插曲,特意记录下来. 首先,我想自己安装个noinstall版本的,结果发信下载下来的和之前版本的不一样,没有data ...

  10. vue - 准备知识

    一.知识 http://www.cnblogs.com/majj/https://www.cnblogs.com/majj/category/1216624.html 阮一峰 es6http://es ...