[英]Extjs: Uncaught TypeError: Object #<Object> has no method 'read'
I wanted to post the answer I found to the error I was getting 我想发布我发现的错误答案
Uncaught TypeError: Object #<Object> has no method 'read'
Hopefully it will save some people a few hours of headache. 希望它可以节省一些人几个小时的头痛。
I traced the code and got to a point where Ext was trying to call the proxies reader.read method. 我跟踪了代码,直到Ext试图调用代理reader.read方法。 But for whatever reason the reader was not being created. 但是无论出于什么原因,都没有创建读者。 I searched around online and found that there's some bug in Ext. 我在网上搜索后发现,Ext中存在一些错误。 At least that seemed to be the consensus. 至少这似乎是共识。
What seemed to solve other's problem and my problem was to either include the models using script tags before creating the stores. 似乎可以解决其他人的问题,而我的问题是要么在创建商店之前就使用脚本标签包含模型。 Or using Ext.require( your models ) before creating the stores. 或在创建商店之前使用Ext.require( 您的模型 )。
Hope this helps! 希望这可以帮助!
===Update=== line 40866 in ext-all-debug.js ===更新=== ext-all-debug.js中的第40866行
if (me.lastFieldGeneration !== **me.model**.prototype.fields.generation) {
me.buildExtractors(true);
}
This is the line that blows up if a model isn't set or undefined. 如果未设置或未定义模型,这条线会炸毁。 Not sure if it has anything to do with the above error, but this is where ext crashed for me with no errors when my model wasn't loading correctly. 不知道它是否与上述错误有关,但是当我的模型加载不正确时,这就是ext崩溃的原因。 This is seems like poor coding to me, referencing something without checking if it's defined or not. 对我来说,这似乎是很差的编码,它引用某些内容而不检查其定义是否正确。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.