背景

用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. JZOJ.5331【NOIP2017模拟8.23】壕游戏

    Description

  2. java.lang.NoSuchMethodException:com.yxq.action.AdminAction.addGoods()《转载》

    java.lang.NoSuchMethodException:com.yxq.action.AdminAction.addGoods()   在学习struts2的时有时会出现此异常,现将其总结如下 ...

  3. WEB安全第六篇--千里之外奇袭客户端:XSS和HTML注入

    零.前言 最近做专心web安全有一段时间了,但是目测后面的活会有些复杂,涉及到更多的中间件.底层安全.漏洞研究与安全建设等越来越复杂的东东,所以在这里想写一个系列关于web安全基础以及一些讨巧的pay ...

  4. IIS7的HTTP到HTTPS的重定向

    方法一设置IIS 从HTTP到HTTPS的IIS7中的所有流量重定向,将确保用户始终安全地访问该网站.有许多不同的方法来设置一个IIS7从HTTP重定向到HTTPS和一些比别人更好.理想的HTTP到H ...

  5. dubbo有什么作用

    转自:http://blog.csdn.net/ichsonx/article/details/39008519 1. Dubbo是什么? Dubbo是一个分布式服务框架,致力于提供高性能和透明化的R ...

  6. JSP教程

    http://www.runoob.com/jsp/jsp-tutorial.html

  7. 【NotePad++】使用指南

    身为一名程序员,这绝对是很常用的工具,但是你真的用了他的全部功能么? 教程参考: [crifan 推荐]轻量级文本编辑器,Notepad 最佳替代品:Notepad++ 注:一个很详细的教程,虽然老, ...

  8. 牛客网多校赛第七场J--Sudoku Subrectangle

    链接:https://www.nowcoder.com/acm/contest/145/J 来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 32768K,其他语言6553 ...

  9. spring boot web服务

    [root@d java]# tree -I target .├── pom.xml└── src ├── main │   ├── java │   │   └── com │   │   └── ...

  10. ios开发 内测包添加测试UDID

    内侧包添加 UDID: 1.蒲公英获取设备UDID  https://www.pgyer.com/udid 2. 登录开发者中心   --> Certificates, Identifiers ...