ExtJS错误解决 Cannot read property 'on' of undefined
背景
用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的更多相关文章
- vue错误提示 Cannot read property 'beforeRouteEnter' of undefined,刷新后跳到首页
vue错误提示 Cannot read property 'beforeRouteEnter' of undefined,刷新后跳到首页 因为vue-router版本太高了,我vue用的是2.3.4, ...
- NodeJS - Express 4.0错误:Cannot read property 'Store' of undefined
按着<NodeJS开发指南>里的第五章建立microblog的例子操作,使用node.js 的express框架配置将session存储到mongodb时出错:TypeError: Can ...
- 记录一次(xheditor-1.1.6-zh-cn.min.js)的错误:Cannot read property 'match' of undefined的问题解决
由于使用了xheditor富文本框,且这个版本是2011年开发的系统,当时只有IE8,所以一切正常. 但是问题来了,今天使用IE11测试和谷歌浏览器测试,发现一直报这个错误: 且google了一下,没 ...
- 73.node.js开发错误——TypeError: Cannot set property 'XXX' of undefined
转自:https://blog.csdn.net/fd214333890/article/details/53467429
- 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 ...
- [转载][jQuery] Cannot read property ‘msie’ of undefined错误的解决方法
参考 [jQuery] Cannot read property ‘msie’ of undefined错误的解决方法 ---------------------------------------- ...
- [jQuery1.9]Cannot read property ‘msie’ of undefined错误的解决方法
原文:[jQuery1.9]Cannot read property 'msie' of undefined错误的解决方法 $.browser在jQuery1.9里被删除了,所以项目的js代码里用到$ ...
- [jQuery] Cannot read property ‘msie’ of undefined错误的解决方法 --转
初用Yii的srbac模块.出现 Cannot read property ‘msie’ of undefined 错误.上网查询,找到如下的文章.使用文末的打补丁的方法,成功搞定.感谢. ===== ...
- [jQuery] Cannot read property ‘msie’ of undefined错误的解决方法
最近把一个项目的jQuery升级到最新版,发现有些页面报错Cannot read property ‘msie’ of undefined.上jQuery网站上搜了一下,原因是$.browser这个a ...
随机推荐
- MS17-010永恒之蓝验证
一.安装MSF,windows下安装也可以,直接安装kali也可以,我是kali是攻击主机,win7是靶机,都在虚拟机里. 1.windows下安装MSF请参考:http://blog.csdn.ne ...
- 关于移动端rem 布局的一些总结
1.rem是什么? rem(font size of the root element)是指相对于根元素的字体大小的单位 2.为什么web app要使用rem? 实现强大的屏幕适配布局(淘宝,腾讯,网 ...
- linux下有趣的几个命令
1.时常我们将频繁使用的‘ls’命令打成‘sl’,那就使用一下sl这个命令吧.在我们敲错的时候,肯定会会心一笑. 安装: yum install sl -y 或 apt-get install sl ...
- 【BZOJ2453】维护队列/【BZOJ2120】数颜色 分块
[BZOJ2453]维护队列 Description 你小时候玩过弹珠吗? 小朋友A有一些弹珠,A喜欢把它们排成队列,从左到右编号为1到N.为了整个队列鲜艳美观,小朋友想知道某一段连续弹珠中,不同颜色 ...
- idea创建maven多应用工程
新建一个project ,名称为ismp,新建三个module,一个公共依赖module common,一个web module adminweb,一个java后台类 user; 目录结构如下: 如果 ...
- onethink文章详情如何做上一篇和下一篇!
其实很简单,如果要做上一篇和下一篇,只要知道当前文章ID的前一个ID和后一个ID即可: //上一篇文章 $prewhere = array(); $prewhere['id'] = array('LT ...
- [python] python单元测试经验总结
python写单元大多数都会用到unittest和mock,测试代码覆盖率都会用到coverage,最后再用nose把所有的东西都串起来,这样每次出版本,都能把整个项目的单元测试都运行一遍. Unit ...
- 170626、springboot编程之静态资源文件
Spring Boot 默认为我们提供了静态资源处理,使用 WebMvcAutoConfiguration 中的配置各种属性. 建议大家使用Spring Boot的默认配置方式,如果需要特殊处理的再通 ...
- 自定义一个ListView实现聊天界面
摘要 ListView可以称得上Android中最常用也最难用的控件了,几乎所有的应用程序都会用到它.由于手机屏幕空间都比较有限,能够一次性在屏幕上显示的内容并不多,当我们的程序中有大量的数据需要展示 ...
- Oracle数据类型number
oracle数值类型只有number number(变长) 1.number可以存放整数,可以存放小数: 2.number(p,s) 说明: p表示有效位,s为小数位:范围p[1,38],s[-84, ...